Skip to content

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
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

@tammy-baylis-swi tammy-baylis-swi moved this from Easy to review / merge / close to Approved PRs in @xrmx's Python PR digest Feb 25, 2025
@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
Member

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
@github-project-automation github-project-automation bot moved this from Approved PRs to Done in @xrmx's Python PR digest Mar 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

The sqlcommenter cannot take non string queries