-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
Migrate XCom model queries to sqlalchemy v2 #37761
Conversation
I will try to update it to make the tests pass without updating them (to ensure it's b/c) |
airflow/models/xcom.py
Outdated
@@ -435,7 +439,7 @@ def get_many( | |||
include_prior_dates: bool = False, | |||
limit: int | None = None, | |||
session: Session = NEW_SESSION, | |||
) -> Query: | |||
) -> Select: |
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.
Hmm, I’m not sure we can change the get_many
return type like this since it is considered a public interface. We need to make the session.scalars
call a part of this 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.
Yes, that's why I converted it to draft: #37761 (comment)
bc6ee94
to
52448f2
Compare
52448f2
to
d19542f
Compare
if first is None: # No matching XCom at all. | ||
return default | ||
if map_indexes is not None or first.map_index < 0: | ||
return XCom.deserialize_value(first) | ||
return first.value | ||
query = query.order_by(None).order_by(XCom.map_index.asc()) | ||
return LazyXComAccess.build_from_xcom_query(query) |
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 will try to find a solution b/c for LazyXComAccess
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions. |
related: #28723