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

Refactor SqlAlchemy Session.execute() to 2.0 style #32857

Merged

Conversation

moiseenkov
Copy link
Contributor

Refactored Session.execute() calls to SqlAlchemy 2.0 style by wrapping plain text SQL queries with text() function.

It eliminates the warning message:
Using plain strings to indicate SQL statements without using the text() construct is deprecated and will be removed in version 2.0. Ensure plain SQL statements are passed using the text() construct. (Background on SQLAlchemy 2.0 at: https://sqlalche.me/e/b8d9)

SqlAlchemy documentation: https://docs.sqlalchemy.org/en/20/changelog/migration_20.html#execute-method-more-strict-execution-options-are-more-prominent

Related issue: #28723

@moiseenkov moiseenkov force-pushed the sqla20_refactore_execute_plain_sql_tex_queries branch from 8591ba4 to a4ac956 Compare July 26, 2023 08:37
Copy link
Member

@uranusjr uranusjr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you amend the commit and force-push to fix the typo in the commit message?

@uranusjr uranusjr changed the title Refactore SqlAlchemy Session.execute() to 2.0 style Refactor SqlAlchemy Session.execute() to 2.0 style Jul 26, 2023
@moiseenkov moiseenkov force-pushed the sqla20_refactore_execute_plain_sql_tex_queries branch from a4ac956 to 87900de Compare July 26, 2023 09:55
@moiseenkov
Copy link
Contributor Author

moiseenkov commented Jul 26, 2023

Can you amend the commit and force-push to fix the typo in the commit message?

@uranusjr , thanks for noticing. Fixed

@VladaZakharova
Copy link
Contributor

Hi @uranusjr !
Wanted to ask if you have some information why the whole update was postponed until release of 2.7?

@jedcunningham jedcunningham added this to the Airflow 2.8.0 milestone Jul 28, 2023
@jedcunningham
Copy link
Member

Looks good. Moving to draft to prevent accidental merge before we get 2.7 out.

@jedcunningham jedcunningham marked this pull request as draft July 28, 2023 23:05
@moiseenkov moiseenkov force-pushed the sqla20_refactore_execute_plain_sql_tex_queries branch 2 times, most recently from 9fecee2 to bafd41d Compare July 31, 2023 10:03
@moiseenkov moiseenkov force-pushed the sqla20_refactore_execute_plain_sql_tex_queries branch 3 times, most recently from fa7ec6e to 20f502c Compare August 11, 2023 07:17
@moiseenkov moiseenkov force-pushed the sqla20_refactore_execute_plain_sql_tex_queries branch 4 times, most recently from 98fef37 to 3910890 Compare August 18, 2023 14:53
@moiseenkov moiseenkov force-pushed the sqla20_refactore_execute_plain_sql_tex_queries branch from 3910890 to 6c4010d Compare August 21, 2023 06:51
@uranusjr
Copy link
Member

2.7.0 is now out!

@uranusjr uranusjr marked this pull request as ready for review August 21, 2023 07:45
@moiseenkov
Copy link
Contributor Author

@uranusjr , thanks for the good news! Can we merge it then?

@moiseenkov
Copy link
Contributor Author

@jedcunningham , @potiuk , hi,
can we merge it please?

@Taragolis Taragolis merged commit 3bb1c07 into apache:main Aug 25, 2023
1 check passed
@ephraimbuddy ephraimbuddy added the type:misc/internal Changelog: Misc changes that should appear in change log label Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:misc/internal Changelog: Misc changes that should appear in change log
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants