You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2019/12/16 09:28:29 UTC

[GitHub] [airflow] ashb commented on a change in pull request #6822: [AIRFLOW-5616] Refactor presto hook to support transactions.

ashb commented on a change in pull request #6822: [AIRFLOW-5616] Refactor presto hook to support transactions.
URL: https://github.com/apache/airflow/pull/6822#discussion_r358124354
 
 

 ##########
 File path: airflow/hooks/presto_hook.py
 ##########
 @@ -134,5 +134,17 @@ def insert_rows(self, table, rows, target_fields=None):
         :type rows: iterable of tuples
         :param target_fields: The names of the columns to fill in the table
         :type target_fields: iterable of strings
+        :param commit_every: The maximum number of rows to insert in one
+            transaction. Set to 0 to insert all rows in one transaction.
+        :type commit_every: int
         """
-        super().insert_rows(table, rows, target_fields, 0)
+        with closing(self.get_conn()) as conn:
+            if conn.isolation_level == 0:
 
 Review comment:
   ```suggestion
               if conn.isolation_level == IsolationLevel.AUTOCOMMIT:
   ```
   right?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services