kazanzhy commented on code in PR #25713:
URL: https://github.com/apache/airflow/pull/25713#discussion_r945316074


##########
airflow/providers/common/sql/hooks/sql.py:
##########
@@ -244,7 +244,9 @@ def split_sql_string(sql: str) -> List[str]:
         :return: list of individual expressions
         """
         splits = sqlparse.split(sqlparse.format(sql, strip_comments=True))
-        statements = [s.rstrip(';') for s in splits if s.endswith(';')]
+        statements: List[str] = list(
+            filter(None, [s.rstrip(';') if s.endswith(';') else s.strip() for 
s in splits])
+        )

Review Comment:
   I wonder what you think about the FP style:
   ```suggestion
   statements: List[str] = list(filter(None, map(lambda x: x.rstrip(';'), 
splits)))
   ```
   
   Seems `sqlparse` already removes spaces from the queries, so probably 
`.strip()` is not needed



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to