Skip to content

Commit 2020a8d

Browse files
committed
Fixed type errors
1 parent 81e5ae5 commit 2020a8d

4 files changed

Lines changed: 55 additions & 17 deletions

File tree

exasol/saas/client/api_access.py

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -287,9 +287,7 @@ def minutes(x: timedelta) -> int:
287287
),
288288
)
289289
database = ensure_type(
290-
ExasolDatabase,
291-
resp,
292-
f"Failed to create database {name}",
290+
ExasolDatabase, resp, f"Failed to create database {name}"
293291
)
294292
LOG.info("Created database with ID %s", database.id)
295293
return database
@@ -369,7 +367,8 @@ def delete_with_retry() -> None:
369367

370368
def list_database_ids(self) -> Iterable[str]:
371369
resp = list_databases.sync(self._account_id, client=self._client) or []
372-
dbs = ensure_type(list[ExasolDatabase], resp, "Failed to list databases")
370+
# actually list[ExasolDatabase]
371+
dbs = ensure_type(list, resp, "Failed to list databases")
373372
return (db.id for db in dbs)
374373

375374
@contextmanager
@@ -440,10 +439,9 @@ def clusters(
440439
)
441440
or []
442441
)
442+
# actually list[openapi.models.Cluster]
443443
return ensure_type(
444-
list[openapi.models.Cluster],
445-
resp,
446-
f"Failed to list clusters of database {database_id}",
444+
list, resp, f"Failed to list clusters of database {database_id}"
447445
)
448446

449447
def get_connection(
@@ -466,11 +464,8 @@ def get_connection(
466464

467465
def list_allowed_ip_ids(self) -> Iterable[str]:
468466
resp = list_allowed_i_ps.sync(self._account_id, client=self._client) or []
469-
ips = ensure_type(
470-
list[openapi.models.AllowedIP],
471-
resp,
472-
"Failed to retrieve the list of allowed ips",
473-
)
467+
# actually list[openapi.models.AllowedIP]
468+
ips = ensure_type(list, resp, "Failed to retrieve the list of allowed ips")
474469
return (x.id for x in ips)
475470

476471
def add_allowed_ip(

poetry.lock

Lines changed: 46 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ pytest = "^7.1.1"
4949
pytest-mock = "^3.7.0"
5050
exasol-toolbox = "^5.1.1"
5151
openapi-python-client = ">=0.26"
52-
pyexasol = ">=1.0.0, <2"
52+
pyexasol = ">=1.0.0, <3"
5353
toml = "^0.10.2"
5454
types-python-dateutil = "^2.9.0.20250516"
5555

@@ -97,8 +97,7 @@ ignore-paths = [
9797

9898
[[tool.mypy.overrides]]
9999
module = [
100-
"test.conftest.*",
101-
"test.*",
100+
"test.*.conftest.*",
102101
]
103102
ignore_errors = true
104103
ignore_missing_imports = true

test/integration/test_databases.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import datetime
21
import logging
32
from datetime import (
43
datetime,

0 commit comments

Comments
 (0)