【问题标题】:Modify BigQuery Operator to pass explicitly JobId argument AirFlow operators修改 BigQuery 运算符以显式传递 JobId 参数 AirFlow 运算符
【发布时间】:2019-07-07 02:02:51
【问题描述】:

我目前正在使用Big-query Operator see here。我需要显式发送用户生成的JobId 参数。

我知道这个操作符默认创建它自己生成的 JobId,但是我有兴趣覆盖这个行为,不幸的是这个操作符不接受 JobId 作为参数。

我尝试通过api_resource_configs 传递这样一个参数并收到以下消息(注意我的 JobId 参数被忽略了):

[2019-02-12 14:01:09,402] {base_task_runner.py:98} INFO - Subtask: /usr/local/lib/airflow/airflow/models.py:2159: PendingDeprecationWarning: Invalid arguments were passed to BigQueryOperator. Support for passing such arguments will be dropped in Airflow 2.0. Invalid arguments were:
[2019-02-12 14:01:09,403] {base_task_runner.py:98} INFO - Subtask: *args: ()
[2019-02-12 14:01:09,403] {base_task_runner.py:98} INFO - Subtask: **kwargs: {'api_resource_configs': {'jobReference': {'jobId': 'goodfornothing'}}}
[2019-02-12 14:01:09,403] {base_task_runner.py:98} INFO - Subtask:   category=PendingDeprecationWarninghere any version of this operator that gets that argument? can i some how modify the operator to accept this argument?

提前致谢!!!!

【问题讨论】:

  • 您使用的是哪个版本的 Airflow?从 V1.10.2 开始引入 api_resource_configs。
  • @RyanTheCoder 谢谢,我使用的是 10.1 版(云作曲家还不支持 10.2)

标签: google-bigquery airflow


【解决方案1】:

由于 api_resource_configs 是在 Airflow v1.10.2 (code) 中引入的,Cloud Composer 尚不支持此版本。您可以考虑将最新的 BigQueryOperator 代码作为您自己的自定义运算符复制到您的项目中。

【讨论】:

    猜你喜欢
    • 2020-11-08
    • 1970-01-01
    • 2021-02-10
    • 2020-12-29
    • 2019-07-10
    • 1970-01-01
    • 2015-09-03
    • 1970-01-01
    • 2018-09-25
    相关资源
    最近更新 更多