Skip to content

Conversation

@vincbeck
Copy link
Contributor

Continue the work started in #32915.
Closes: #30287.


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

Ashwaq Reheman and others added 4 commits November 30, 2023 13:41
This test case ensures that the RedshiftToS3Operator correctly handles a custom select_query containing single quotes. It validates that the operator generates a proper UNLOAD query that handles single quotes, thereby confirming its functionality in such scenarios.
@boring-cyborg boring-cyborg bot added area:providers provider:amazon AWS/Amazon - related issues labels Nov 30, 2023
@o-nikolas
Copy link
Contributor

CC @cjames23

Copy link
Contributor

@cjames23 cjames23 left a comment

Choose a reason for hiding this comment

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

Looks good to me!

self, credentials_block: str, select_query: str, s3_key: str, unload_options: str
) -> str:
# Un-escape already escaped queries
select_query = select_query.replace("''", "'")
Copy link
Member

Choose a reason for hiding this comment

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

Would this break empty string literals…?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ouh! That's a good catch!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I addressed it in 7d06f1e259a695fc68e16e50e9562f514dbb757d. I also added a unit test for this use case

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

Labels

area:providers provider:amazon AWS/Amazon - related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RedshiftToS3 Operator Wrapping Query in Quotes Instead of $$

6 participants