You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "uranusjr (via GitHub)" <gi...@apache.org> on 2023/12/01 04:11:25 UTC

Re: [PR] Fix handling of single quotes in `RedshiftToS3Operator` [airflow]

uranusjr commented on code in PR #35986:
URL: https://github.com/apache/airflow/pull/35986#discussion_r1411578589


##########
airflow/providers/amazon/aws/transfers/redshift_to_s3.py:
##########
@@ -141,8 +141,10 @@ def __init__(
     def _build_unload_query(
         self, credentials_block: str, select_query: str, s3_key: str, unload_options: str
     ) -> str:
+        # Un-escape already escaped queries
+        select_query = select_query.replace("''", "'")

Review Comment:
   Would this break empty string literals…?



##########
airflow/providers/amazon/aws/transfers/redshift_to_s3.py:
##########
@@ -141,8 +141,10 @@ def __init__(
     def _build_unload_query(
         self, credentials_block: str, select_query: str, s3_key: str, unload_options: str
     ) -> str:
+        # Un-escape already escaped queries
+        select_query = select_query.replace("''", "'")

Review Comment:
   Would this break empty string literals…?



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