Apache Airflow version: 2.0.1
Kubernetes version (if you are using kubernetes) (use kubectl version):
1.18 on GKE
Environment: Google Cloud Platform - Cloud Composer
- Cloud provider or hardware configuration: GCP - Cloud Composer composer-1.17.0-preview.5-airflow-2.0.1
- OS (e.g. from /etc/os-release):
- Kernel (e.g.
uname -a):
- Install tools:
- Others:
What happened:
Error in the doc and dag example for DataflowJobStatusSensor
this generates the following error in the log:
{taskinstance.py:1457} ERROR - 'dict object' has no attribute 'job_id'
What you expected to happen:
XCOM is pulled and dataflow job id should be obtained from XCOM attributes.
However it is not. An incorrect attribute name is used.
the XCOM doesn't have any attribute named "job_id" when using :
job_id="{{task_instance.xcom_pull('start-python-job-async')['job_id']}}",
instead "id" has to be used to get the related Dataflow job id.
How to reproduce it:
create a DAG
add a task to run a dataflow job using DataflowTemplatedJobStartOperator in async mode.
add task to check for job status using the example code for DataflowJobStatusSensor provided here:
https://airflow.apache.org/docs/apache-airflow-providers-google/stable/_modules/airflow/providers/google/cloud/example_dags/example_dataflow.html
and more precisely here:
https://github.com/apache/airflow/blob/main/airflow/providers/google/cloud/example_dags/example_dataflow.py#L169
Anything else we need to know:
Apache Airflow version: 2.0.1
Kubernetes version (if you are using kubernetes) (use
kubectl version):1.18 on GKE
Environment: Google Cloud Platform - Cloud Composer
uname -a):What happened:
Error in the doc and dag example for DataflowJobStatusSensor
this generates the following error in the log:
{taskinstance.py:1457} ERROR - 'dict object' has no attribute 'job_id'
What you expected to happen:
XCOM is pulled and dataflow job id should be obtained from XCOM attributes.
However it is not. An incorrect attribute name is used.
the XCOM doesn't have any attribute named "job_id" when using :
job_id="{{task_instance.xcom_pull('start-python-job-async')['job_id']}}",
instead "id" has to be used to get the related Dataflow job id.
How to reproduce it:
create a DAG
add a task to run a dataflow job using DataflowTemplatedJobStartOperator in async mode.
add task to check for job status using the example code for DataflowJobStatusSensor provided here:
https://airflow.apache.org/docs/apache-airflow-providers-google/stable/_modules/airflow/providers/google/cloud/example_dags/example_dataflow.html
and more precisely here:
https://github.com/apache/airflow/blob/main/airflow/providers/google/cloud/example_dags/example_dataflow.py#L169
Anything else we need to know: