Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

hussein-awala
Copy link
Member

related: #28723

@hussein-awala hussein-awala marked this pull request as draft February 27, 2024 23:43
@hussein-awala
Copy link
Member Author

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 Show resolved Hide resolved
@@ -435,7 +439,7 @@ def get_many(
include_prior_dates: bool = False,
limit: int | None = None,
session: Session = NEW_SESSION,
) -> Query:
) -> Select:
Copy link
Member

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.

Copy link
Member Author

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)

@hussein-awala hussein-awala force-pushed the sqlalchemy_v2_xcom branch 2 times, most recently from bc6ee94 to 52448f2 Compare March 2, 2024 23:17
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)
Copy link
Member Author

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

Copy link

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.

@github-actions github-actions bot added the stale Stale PRs per the .github/workflows/stale.yml policy file label Apr 17, 2024
@github-actions github-actions bot closed this Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Stale PRs per the .github/workflows/stale.yml policy file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants