Skip to content

Commit 0c938ca

Browse files
committed
fix
1 parent 16e5478 commit 0c938ca

3 files changed

Lines changed: 10 additions & 4 deletions

File tree

src/datacustomcode/cli.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,11 @@ def version():
5050
@click.option("--client-id", prompt=True)
5151
@click.option("--client-secret", prompt=True)
5252
@click.option("--login-url", prompt=True)
53-
@click.option("--dataspace", default="default", help="Dataspace name (optional, for non-default dataspaces)")
53+
@click.option(
54+
"--dataspace",
55+
default="default",
56+
help="Dataspace name (optional, for non-default dataspaces)",
57+
)
5458
def configure(
5559
username: str,
5660
password: str,

src/datacustomcode/credentials.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ def from_env(cls) -> Credentials:
6565
credentials_data = {}
6666
for k, v in ENV_CREDENTIALS.items():
6767
if k == "dataspace":
68-
credentials_data[k] = os.environ.get(v)
68+
dataspace_value = os.environ.get(v)
69+
if dataspace_value is not None:
70+
credentials_data[k] = dataspace_value
6971
else:
7072
credentials_data[k] = os.environ[v]
7173
return cls(**credentials_data)
@@ -103,7 +105,7 @@ def update_ini(self, profile: str = "default", ini_file: str = INI_FILE):
103105
config[profile]["client_id"] = self.client_id
104106
config[profile]["client_secret"] = self.client_secret
105107
config[profile]["login_url"] = self.login_url
106-
108+
107109
if self.dataspace is not None:
108110
config[profile]["dataspace"] = self.dataspace
109111

src/datacustomcode/io/reader/query_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def __init__(
8888
credentials.client_id,
8989
credentials.client_secret,
9090
]
91-
91+
9292
connection_kwargs = {}
9393
if credentials.dataspace is not None:
9494
connection_kwargs["dataspace"] = credentials.dataspace

0 commit comments

Comments
 (0)