-
Notifications
You must be signed in to change notification settings - Fork 666
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
bug_fix(1477): type handling in _add_sql_comment #3113
base: main
Are you sure you want to change the base?
Conversation
|
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.
Thanks for the PR, could you please add a test so we are sure that the code is fixing the reported issue?
opentelemetry-instrumentation/src/opentelemetry/instrumentation/sqlcommenter_utils.py
Outdated
Show resolved
Hide resolved
5cb5d9d
to
577f808
Compare
5e98fce
to
cc7332d
Compare
Thanks @aryabharat . Please could you update CHANGELOG.md with this PR? |
Done |
@tammy-baylis-swi Please let me what all changes are required. |
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.
Thanks again! Lgtm
@Kludex Please can you review? |
@xrmx @tammy-baylis-swi can we merge this? |
Description
This PR fixes an issue with SQL comment generation, the current implementation fails when processing non-string SQL queries, particularly those from psycopg2's SQL utilities.
Modified _add_sql_comment() function to handles different SQL query types by converting incoming sql queries to strings
Preserves the original query if comment generation fails
Fixes #1477
Type of change
Please delete options that are not relevant.