From ef870981d8b494ebfc65a433d07647a320cab2b9 Mon Sep 17 00:00:00 2001 From: Adrian Date: Wed, 14 Sep 2022 14:52:59 +0200 Subject: [PATCH] add default location --- dlt/pipeline/typing.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlt/pipeline/typing.py b/dlt/pipeline/typing.py index 778de04d59..1cfc7cc68d 100644 --- a/dlt/pipeline/typing.py +++ b/dlt/pipeline/typing.py @@ -51,7 +51,7 @@ def default_dataset(self, new_value: str) -> None: @classmethod def from_services_dict(cls, services: StrAny, dataset_prefix: str, location: str) -> "GCPPipelineCredentials": assert dataset_prefix is not None - return cls("bigquery", services["project_id"], dataset_prefix, services["client_email"], services["private_key"], location) + return cls("bigquery", services["project_id"], dataset_prefix, services["client_email"], services["private_key"], location or cls.LOCATION) @classmethod def from_services_file(cls, services_path: str, dataset_prefix: str, location: str) -> "GCPPipelineCredentials": @@ -61,7 +61,7 @@ def from_services_file(cls, services_path: str, dataset_prefix: str, location: s @classmethod def default_credentials(cls, dataset_prefix: str, project_id: str = None, location: str = None) -> "GCPPipelineCredentials": - return cls("bigquery", project_id, dataset_prefix, None, None, location) + return cls("bigquery", project_id, dataset_prefix, None, None, location or cls.LOCATION) @dataclass