Skip to content

Commit 42dc513

Browse files
committed
Fix typehints and remove type ignores for ctl.importer
This change also highlighted an issue as we were still running aiorun to get the client.
1 parent 43879f6 commit 42dc513

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

infrahub_sdk/ctl/importer.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from .parameters import CONFIG_PARAM
1313

1414

15-
def local_directory():
15+
def local_directory() -> Path:
1616
# We use a function here to avoid failure when generating the documentation due to directory name
1717
return Path().resolve()
1818

@@ -35,9 +35,10 @@ def load(
3535
"""Import nodes and their relationships into the database."""
3636
console = Console()
3737

38-
client = aiorun(
39-
initialize_client(branch=branch, timeout=timeout, max_concurrent_execution=concurrent, retry_on_failure=True)
38+
client = initialize_client(
39+
branch=branch, timeout=timeout, max_concurrent_execution=concurrent, retry_on_failure=True
4040
)
41+
4142
importer = LineDelimitedJSONImporter(
4243
client,
4344
InfrahubSchemaTopologicalSorter(),

pyproject.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,6 @@ ignore_errors = true
167167
module = "infrahub_sdk.ctl.generator"
168168
ignore_errors = true
169169

170-
[[tool.mypy.overrides]]
171-
module = "infrahub_sdk.ctl.importer"
172-
ignore_errors = true
173-
174170
[[tool.mypy.overrides]]
175171
module = "infrahub_sdk.ctl.schema"
176172
ignore_errors = true

0 commit comments

Comments
 (0)