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 2021/08/18 18:46:42 UTC

[GitHub] [airflow] subkanthi opened a new pull request #17695: Fix sqlite hook - insert and replace functions

subkanthi opened a new pull request #17695:
URL: https://github.com/apache/airflow/pull/17695


   closes: #17632 
   
   override _generate_insert_sql()  in sqlite hook to use '?' instead of the standard '%' for replacing.
   Added unit tests and example of insert/replace in example dag.


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

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



[GitHub] [airflow] subkanthi commented on a change in pull request #17695: Fix sqlite hook - insert and replace functions

Posted by GitBox <gi...@apache.org>.
subkanthi commented on a change in pull request #17695:
URL: https://github.com/apache/airflow/pull/17695#discussion_r691529538



##########
File path: airflow/hooks/dbapi.py
##########
@@ -324,6 +324,7 @@ def insert_rows(self, table, rows, target_fields=None, commit_every=1000, replac
                         lst.append(self._serialize_cell(cell, conn))
                     values = tuple(lst)
                     sql = self._generate_insert_sql(table, values, target_fields, replace, **kwargs)
+                    self.log.info(f"Generated sql: {sql}")

Review comment:
       Fixed. Thanks, @potiuk 




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

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



[GitHub] [airflow] potiuk commented on pull request #17695: Fix sqlite hook - insert and replace functions

Posted by GitBox <gi...@apache.org>.
potiuk commented on pull request #17695:
URL: https://github.com/apache/airflow/pull/17695#issuecomment-901409656


   Thanks! @subkanthi 


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

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



[GitHub] [airflow] potiuk merged pull request #17695: Fix sqlite hook - insert and replace functions

Posted by GitBox <gi...@apache.org>.
potiuk merged pull request #17695:
URL: https://github.com/apache/airflow/pull/17695


   


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

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



[GitHub] [airflow] github-actions[bot] commented on pull request #17695: Fix sqlite hook - insert and replace functions

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #17695:
URL: https://github.com/apache/airflow/pull/17695#issuecomment-901408486


   The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest main at your convenience, or amend the last commit of the PR, and push it with --force-with-lease.


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

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



[GitHub] [airflow] potiuk commented on a change in pull request #17695: Fix sqlite hook - insert and replace functions

Posted by GitBox <gi...@apache.org>.
potiuk commented on a change in pull request #17695:
URL: https://github.com/apache/airflow/pull/17695#discussion_r691519151



##########
File path: airflow/hooks/dbapi.py
##########
@@ -324,6 +324,7 @@ def insert_rows(self, table, rows, target_fields=None, commit_every=1000, replac
                         lst.append(self._serialize_cell(cell, conn))
                     values = tuple(lst)
                     sql = self._generate_insert_sql(table, values, target_fields, replace, **kwargs)
+                    self.log.info(f"Generated sql: {sql}")

Review comment:
       This might be a bit too agressive. Please change it to debug, also use "%" format of log.* rather than f-string for performance. 




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

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