-
Notifications
You must be signed in to change notification settings - Fork 16.3k
Cast macro datetime string inputs explicitly #19592
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest main at your convenience, or amend the last commit of the PR, and push it with --force-with-lease. |
|
I think test_airflow_context needs fixing @uranusjr |
10ab701 to
ba5cd22
Compare
|
Weird, this PR does not change anything related to that. I’ll rebase to latest and see if that fixes things... |
This coerce template variables to strings to work around a limitation in lazy_object_proxy when used against built-in types. Some tests against macro functions are added to ensure macro functions all work against lazy object proxy objects and avoid regression in the future. Co-Authored-By: ShaharPotash1 <67375630+ShaharPotash1@users.noreply.github.com>
ba5cd22 to
1d6d179
Compare
|
I'd feel safer if it is rebased again after the fix from Ash :) |
This coerce template variables to strings to work around a limitation in lazy_object_proxy when used against built-in types. Some tests against macro functions are added to ensure macro functions all work against lazy object proxy objects and avoid regression in the future.
This coerce template variables to strings to work around a limitation in lazy_object_proxy when used against built-in types. Some tests against macro functions are added to ensure macro functions all work against lazy object proxy objects and avoid regression in the future. (cherry picked from commit fca2b19)
|
@potiuk We recently upgraded to 2.2.2 and are facing this issue in our dags which have some macros as below : Is upgrading to 2.2.3 the only solution ? |
It's certainly the best. |
|
@potiuk Upgrading will be an issue as it involves a long wait time. Have come up with the below 2 approaches as a fix for the time being.
|
Sure you can come up with your own solutions if "not upgrading to a released patchlevel that contains a fix" is your own choice. But please don't ask maintainers to come up with workarounds if they already provided a fix that you can easily install. There is no way maintainers can give you another answer here - asking for it is quite unreasonable, because - the fix is there. What happens if (say) tomorrow we release 2.2.4 with a critical security fix (like Log4j) ? Would you take the risk of scrambling and trying to upgrade everything under the pressure of not only your security team but also your boss who will insist on fixing it "now". By not upgrading to latest released patchlevel, especially when it contains a fix to a known problem you have and opting to choose a workaround instead, you make yourself vulnerable to this scenario. But do not ask maintainers to either help you with it or endorse it, because we would be shooting ourselves in a foot (and your foot) by suggesting it. Of course, you are free to do what you want - we cannot stop you. But you've been warned. BTW. No 2.2.3 does not have any long migrations comparing to 2.2.2: https://airflow.apache.org/docs/apache-airflow/stable/migrations-ref.html?highlight=migrations it just adds one column to one table which should be almost instantenous. I'd really, really recommend you to upgrade. |
|
I understand that airflow version upgrade is the optimal solution for this and we will be doing the same in dev . The long wait time is not w.r.t to Airflow migration in itself but certain process that we need to adhere to , any version upgrade needs to go under sanity test in dev for a period of time before it is pushed to prod. |
|
I can only sympathise with your pain. But it does not change my answer. |
|
Suggestion (this is the advice I have from one of the best Project Managers I worked with)
|
Finishing and close #19249. Fix #19241.
This coerce template variables to strings to work around a limitation in lazy_object_proxy when used against built-in types.
Some tests against macro functions are added to ensure macro functions all work against lazy object proxy objects and avoid regression in the future.