Ejemplo n.º 1
0
 def poke(self, context):
     table_uri = '{0}:{1}.{2}'.format(self.project_id, self.dataset_id,
                                      self.table_id)
     self.log.info('Sensor checks existence of table: %s', table_uri)
     hook = BigQueryHook(bigquery_conn_id=self.bigquery_conn_id,
                         delegate_to=self.delegate_to)
     return hook.table_exists(self.project_id, self.dataset_id,
                              self.table_id)
Ejemplo n.º 2
0
 def poke(self, context: dict) -> bool:
     table_uri = f'{self.project_id}:{self.dataset_id}.{self.table_id}'
     self.log.info('Sensor checks existence of table: %s', table_uri)
     hook = BigQueryHook(
         bigquery_conn_id=self.bigquery_conn_id,
         delegate_to=self.delegate_to,
         impersonation_chain=self.impersonation_chain,
     )
     return hook.table_exists(project_id=self.project_id,
                              dataset_id=self.dataset_id,
                              table_id=self.table_id)