You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "vincbeck (via GitHub)" <gi...@apache.org> on 2023/08/07 15:51:34 UTC
[GitHub] [airflow] vincbeck commented on a diff in pull request #32915: Fix handling of single quotes in RedshiftToS3Operator
vincbeck commented on code in PR #32915:
URL: https://github.com/apache/airflow/pull/32915#discussion_r1286077972
##########
airflow/providers/amazon/aws/transfers/redshift_to_s3.py:
##########
@@ -144,7 +144,7 @@ def _build_unload_query(
self, credentials_block: str, select_query: str, s3_key: str, unload_options: str
) -> str:
return f"""
- UNLOAD ('{select_query}')
+ UNLOAD ($${select_query}$$)
Review Comment:
Yeah this solution can work. Or all the way around, you replace `""` with `"` and keep using `$$`. This solution MIGHT be better because, as you pointed out, queries with `""` are rare and as such the replace will be here "just in case". But I definitely think this is worth handling this use case, otherwise your change will be breaking for any query using already `""`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org