hussein-awala commented on code in PR #30655:
URL: https://github.com/apache/airflow/pull/30655#discussion_r1167559938


##########
airflow/providers/google/cloud/hooks/bigquery.py:
##########
@@ -2077,6 +2082,9 @@ def run_query(
         labels = labels or self.labels
         schema_update_options = list(schema_update_options or [])
 
+        if priority:
+            self.priority = priority
+

Review Comment:
   I think you should not update the class instance attribute:
   ```python
   # if you create a hook with default priority BATCH
   hook = BigQueryHook(..., priority="BATCH")
   # the you run a query with priority INTERACTIVE
   hook.run_query(..., priority="INTERACTIVE")
   # finally, if you run another query without priority argument, it should use 
the one
   # provided on the instance creation (BATCH), but it is not the case
   hook.run_query(....)  # self.priority is set to INTERACTIVE
   ```



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