You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "ying-w (via GitHub)" <gi...@apache.org> on 2023/04/15 15:25:33 UTC
[GitHub] [airflow] ying-w commented on a diff in pull request #30655: Add `priority` parameter to BigQueryHook
ying-w commented on code in PR #30655:
URL: https://github.com/apache/airflow/pull/30655#discussion_r1167567344
##########
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'm OK working off `BigQueryHook()` but was wondering if the preferred way to submit arbitrary sql is to leverage `SQLExecuteQueryOperator()` under commons.
I'm pretty new to airflow and wasn't sure when I should start with operator vs starting with hook. It didn't seem like there was an obvious way of passing in a modified hook into `SQLExecuteQueryOperator()`
If I use `BigQueryInsertJobOperator()` (the bigquery specific way of doing `SQLExecuteQueryOperator()`) then I would need to create a custom operator based on `BigQueryInsertJobOperator()` that overwrites `_submit_job()` since that calls `BigQueryHook()` and operator class also doesn't have `priority` as a class attribute.
--
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