I have an object I've passed to xcom that I want to read from an operator.
Here is my operator:
load_csv = GCSToBigQueryOperator(
task_id='gcs_to_bigquery',
bucket='test',
source_objects=['{{ execution_date.strftime("%Y-%m") }}'],
providers=True,
destination_project_dataset_table=f'{stg_dataset_name}' + '.' + '{{ execution_date.strftime("%Y_%m") }}',
schema_fields={{ti.xcom_pull(task_ids='print_the_context')}},
write_disposition='WRITE_TRUNCATE',
provide_context=True,
dag=dag)
I want to pass the value from xcom to the schema_fields
variable.
I'm trying to access the object using the following template {{ti.xcom_pull(task_ids='print_the_context')}}
but I have it is not defined
...
What's wrong here?