-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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
Fix literal cross product expansion #23434
Fix literal cross product expansion #23434
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doh!
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. |
if total == 0: | ||
total = len(value) | ||
else: | ||
total *= len(value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we could have total = 1
at the beginning of the function instead…?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried that, and that's how I found the .expand()
bug. If we can assume we will always have at least something with a length, we could, but this felt more defensive.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let’s do this right now and maybe change it when we fix the expand
bug. That way we can keep main working correctly.
6c1b1df
to
8946e36
Compare
8946e36
to
3be09f4
Compare
(cherry picked from commit 3fb8e0b)
(cherry picked from commit 3fb8e0b)
Closes: #23425
parse_time_mapped_ti_count
wasn't taking into account the cross product behavior of expansion.