@@ -361,13 +361,16 @@ class BigQueryGetDataOperator(BaseOperator):
361361 task_id='get_data_from_bq',
362362 dataset_id='test_dataset',
363363 table_id='Transaction_partitions',
364+ project_id='internal-gcp-project',
364365 max_results=100,
365366 selected_fields='DATE',
366367 gcp_conn_id='airflow-conn-id'
367368 )
368369
369370 :param dataset_id: The dataset ID of the requested table. (templated)
370371 :param table_id: The table ID of the requested table. (templated)
372+ :param project_id: (Optional) The name of the project where the data
373+ will be returned from. (templated)
371374 :param max_results: The maximum number of records (rows) to be fetched
372375 from the table. (templated)
373376 :param selected_fields: List of fields to return (comma-separated). If
@@ -390,6 +393,7 @@ class BigQueryGetDataOperator(BaseOperator):
390393 template_fields : Sequence [str ] = (
391394 'dataset_id' ,
392395 'table_id' ,
396+ 'project_id' ,
393397 'max_results' ,
394398 'selected_fields' ,
395399 'impersonation_chain' ,
@@ -401,6 +405,7 @@ def __init__(
401405 * ,
402406 dataset_id : str ,
403407 table_id : str ,
408+ project_id : Optional [str ] = None ,
404409 max_results : int = 100 ,
405410 selected_fields : Optional [str ] = None ,
406411 gcp_conn_id : str = 'google_cloud_default' ,
@@ -419,6 +424,7 @@ def __init__(
419424 self .delegate_to = delegate_to
420425 self .location = location
421426 self .impersonation_chain = impersonation_chain
427+ self .project_id = project_id
422428
423429 def execute (self , context : 'Context' ) -> list :
424430 self .log .info (
@@ -445,6 +451,7 @@ def execute(self, context: 'Context') -> list:
445451 max_results = self .max_results ,
446452 selected_fields = self .selected_fields ,
447453 location = self .location ,
454+ project_id = self .project_id ,
448455 )
449456
450457 self .log .info ('Total extracted rows: %s' , len (rows ))
0 commit comments