Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

bug_fix(1477): type handling in _add_sql_comment #3113

Open
wants to merge 22 commits into
base: main
Choose a base branch
from

Conversation

aryabharat
Copy link

@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
@tammy-baylis-swi
Copy link
Contributor

Thanks @aryabharat . Please could you update CHANGELOG.md with this PR?

@aryabharat
Copy link
Author

Thanks @aryabharat . Please could you update CHANGELOG.md with this PR?

Done

@aryabharat aryabharat closed this Feb 19, 2025
@aryabharat aryabharat reopened this Feb 19, 2025
@aryabharat
Copy link
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
Author

@Kludex Please can you review?

@aryabharat
Copy link
Author

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

# for free to join this conversation on GitHub. Already have an account? # 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