文档说明该参数source_objects
采用模板值。但是,当我尝试以下操作时:
gcs_to_bq_op = GoogleCloudStorageToBigQueryOperator(
task_id=name,
bucket='gdbm-public',
source_objects=['entity/{{ ds_nodash }}.0.{}.json'.format(filename)],
destination_project_dataset_table='dbm_public_entity.{}'.format(name),
schema_fields=schema,
source_format='NEWLINE_DELIMITED_JSON',
create_disposition='CREATE_IF_NEEDED',
write_disposition='WRITE_TRUNCATE',
max_bad_records=0,
allow_jagged_rows=True,
google_cloud_storage_conn_id='my_gcp_conn',
bigquery_conn_id='my_gcp_conn',
delegate_to=SERVICE_ACCOUNT,
dag=dag
)
我收到错误消息:
Exception: BigQuery job failed. Final error was: {u'reason': u'notFound', u'message': u'Not found: URI gs://gdbm-public/entity/{ ds_nodash }.0.GeoLocation.json'}.
我找到了一个以相同方式使用变量的示例。{{ ds_nodash }}
所以我不确定为什么这对我不起作用。