Beispiel #1
0
 def _make_bigquery_client(self) -> List[GCPLoggingClient]:
     # See https://github.com/googleapis/google-cloud-python/issues/2674 for
     # why we disable gRPC here.
     client_options = self.config.extra_client_options.copy()
     client_options["_use_grpc"] = False
     project_id = self.config.project_id
     if project_id is not None:
         return [GCPLoggingClient(**client_options, project=project_id)]
     else:
         return [GCPLoggingClient(**client_options)]
Beispiel #2
0
    def __init__(self, config: BigQueryUsageConfig, ctx: PipelineContext):
        super().__init__(ctx)
        self.config = config
        self.report = BigQueryUsageSourceReport()

        client_options = self.config.extra_client_options.copy()
        if self.config.project_id is not None:
            client_options["project"] = self.config.project_id

        # See https://github.com/googleapis/google-cloud-python/issues/2674 for
        # why we disable gRPC here.
        self.client = GCPLoggingClient(**client_options, _use_grpc=False)