uranusjr commented on a change in pull request #17329:
URL: https://github.com/apache/airflow/pull/17329#discussion_r716129135
##########
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]
+
+ return [
+ s.rstrip(';') if strip_semicolon else s
Review comment:
When would this semicolon stripping be useful?
--
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]