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


##########
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:
   ```suggestion
           statements = list(
               filter(None, (s.rstrip(';') if s.endswith(';') else s for s in 
splits))
           )
   ```
   
   The `strip()` in the `else` part isn’t consistent. Alternatively, `strip()` 
should be done for both cases:
   
   ```python
   statements = (s.rstrip(';') if s.endswith(';') else s for s in splits)
   statements = (s.strip() for s in statements)
   return [s for s in statements if s]
   ```



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