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

bug_fix(1477): type handling in _add_sql_comment #3113

Merged
merged 27 commits into from
Mar 27, 2025

Conversation

aryabharat
Copy link
Contributor

@aryabharat aryabharat commented Dec 17, 2024

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.

  • Bug fix (non-breaking change which fixes an issue)

@aryabharat aryabharat requested a review from a team as a code owner December 17, 2024 17:20
Copy link

linux-foundation-easycla bot commented Dec 17, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

Copy link
Contributor

@xrmx xrmx left a 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?

@xrmx xrmx self-requested a review January 15, 2025 10:41
@aryabharat aryabharat reopened this Feb 19, 2025
@aryabharat
Copy link
Contributor Author

@tammy-baylis-swi Please let me what all changes are required.

Copy link
Contributor

@tammy-baylis-swi tammy-baylis-swi left a comment

Choose a reason for hiding this comment

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

Thanks again! Lgtm

@aryabharat aryabharat requested a review from Kludex February 25, 2025 19:14
@aryabharat
Copy link
Contributor Author

@Kludex Please can you review?

@aryabharat
Copy link
Contributor Author

@xrmx @tammy-baylis-swi can we merge this?

@aryabharat
Copy link
Contributor Author

Hi @Kludex can we merge this?

@Kludex
Copy link
Contributor

Kludex commented Mar 26, 2025

Please stop pinging me.

I do not have bandwidth to review this again. I've shared my concerns already.

@aryabharat
Copy link
Contributor Author

Please stop pinging me.

I do not have bandwidth to review this again. I've shared my concerns already.

I have replied to your comment.

@aryabharat
Copy link
Contributor Author

@xrmx Please have a look, if this is not accepted then we can close this PR.
Thanks.

@xrmx
Copy link
Contributor

xrmx commented Mar 26, 2025

@aryabharat Please stop pinging people, this will be merged eventually.

@xrmx xrmx merged commit 50ab047 into open-telemetry:main Mar 27, 2025
712 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The sqlcommenter cannot take non string queries