-
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
Refactor Sqlalchemy queries to 2.0 style (Part 3) #32177
Conversation
09a3e7d
to
66e71dc
Compare
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.
Changes look good to me
0d68ef2
to
52bb22e
Compare
@@ -1304,10 +1306,10 @@ def _dangling_against_task_instance(session, source_table, dag_run, task_instanc | |||
) | |||
|
|||
return ( | |||
session.query(*[c.label(c.name) for c in source_table.c]) | |||
select(*[c.label(c.name) for c in source_table.c]) |
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 also change this to select(*(...))
(in the other planned PR). There are several of these around in this file too.
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.
@uranusjr Creating a tuple rather than a list is more efficient?
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.
This does not create an intermediate tuple but expands a generator directly. With *[]
the generator is first realised into a list and then the list is expanded.
52bb22e
to
0660b4e
Compare
71a2ee7
to
54d3593
Compare
54d3593
to
c56bafc
Compare
…)" This reverts commit 1065687.
As discussed in #32343 - this one is reverted and needs to be reapplied with "full tests needed" :(. |
This is a continuation of the effort to refactor the queries to sqlalchemy 2.0
cc @ephraimbuddy @uranusjr
related: #28723
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rst
or{issue_number}.significant.rst
, in newsfragments.