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

[GitHub] [airflow] o-nikolas commented on a diff in pull request #30300: Fix Redshift unload query when select query contains single quotes

o-nikolas commented on code in PR #30300:
URL: https://github.com/apache/airflow/pull/30300#discussion_r1167327215


##########
airflow/providers/amazon/aws/transfers/redshift_to_s3.py:
##########
@@ -143,8 +144,17 @@ def __init__(
     def _build_unload_query(
         self, credentials_block: str, select_query: str, s3_key: str, unload_options: str
     ) -> str:
+        # TODO: remove in provider 8.0.0
+        if "''" in select_query:
+            logging.warning(

Review Comment:
   +1
   Users may stumble on this in the future after you have removed the check.
   
   Also is it possible the string contains some double quotes but not everywhere? Do we want to try handle these half working situations? This type of string sanitization code can often get very hairy very quick. Is there a thirdparty library we can use instead which specializes in this? 



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