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

Update SQLAlchemy instrumentor tests to work with SQLAlchemy 2 #2975

Closed
tammy-baylis-swi opened this issue Nov 7, 2024 · 0 comments · Fixed by #2976
Closed

Update SQLAlchemy instrumentor tests to work with SQLAlchemy 2 #2975

tammy-baylis-swi opened this issue Nov 7, 2024 · 0 comments · Fixed by #2976
Assignees

Comments

@tammy-baylis-swi
Copy link
Contributor

tammy-baylis-swi commented Nov 7, 2024

What problem do you want to solve?

The method sqlalchemy.engine.Connection.execute still accepts a regular string as query statement in SQLAlchemy 1.4, but it's no longer possible in SQLAlchemy 2:

Deprecated since version 2.0: passing a string to Connection.execute() is deprecated and will be removed in version 2.0. Use the text() construct with Connection.execute(), or the Connection.exec_driver_sql() method to invoke a driver-level SQL string.

See also https://docs.sqlalchemy.org/en/14/core/connections.html#sqlalchemy.engine.Connection.execute

This is an issue because several of the SQLAlchemy instrumentor tests still pass str instead of sqlalchemy.text, and the tests will fail if run with SQLAlchemy 2.

Describe the solution you'd like

I will update the tests.

Describe alternatives you've considered

No response

Additional Context

Related to #2970

Would you like to implement a fix?

Yis

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant