uranusjr commented on a change in pull request #17329:
URL: https://github.com/apache/airflow/pull/17329#discussion_r716129072



##########
File path: airflow/hooks/dbapi.py
##########
@@ -259,6 +266,27 @@ def get_cursor(self):
         """Returns a cursor"""
         return self.get_conn().cursor()
 
+    @staticmethod
+    def _split_sql_statements(sql, strip_comments=True, strip_semicolon=True, 
**kwargs):
+        """
+        Split multiple sql statements in string
+
+        :param sql: sql statements.
+        :type sql: str or list.
+        :return: splitted sql statements.
+        :rtype: list.
+        """
+        if isinstance(sql, str):
+            sql = [sql]

Review comment:
       I don’t think this is needed? Because you always wrap a str in a list on 
the call site (in `run`). Since this is a private method, always requiring a 
`List[str]` would make things cleaner. A type annotation on the function 
argument would help as well.




-- 
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-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to