Skip to content

Commit

Permalink
Fixing pre-commit again
Browse files Browse the repository at this point in the history
  • Loading branch information
pgoslatara committed Nov 7, 2024
1 parent bd9c7aa commit 294a9b1
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/dbt_bouncer/utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# mypy: disable-error-code="arg-type"
# mypy: disable-error-code="union-attr"
# mypy: disable-error-code="arg-type,attr-defined,union-attr"

"""Re-usable functions for dbt-bouncer."""

Expand Down Expand Up @@ -117,8 +116,8 @@ def get_check_objects() -> List[Type["BaseCheck"]]:

def import_check(check_class_name: str, check_file_path: str) -> None:
"""Import the Check* class to locals()."""
spec = importlib.util.spec_from_file_location(check_class_name, check_file_path) # type: ignore[attr-defined]
module = importlib.util.module_from_spec(spec) # type: ignore[attr-defined]
spec = importlib.util.spec_from_file_location(check_class_name, check_file_path)
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)
sys._getframe().f_locals[check_class_name] = module
check_objects.append(locals()[check_class_name])
Expand Down Expand Up @@ -147,8 +146,8 @@ def import_check(check_class_name: str, check_file_path: str) -> None:
logging.debug(f"{custom_check_files=}")

for check_file in custom_check_files:
spec = importlib.util.spec_from_file_location("custom_check", check_file) # type: ignore[attr-defined]
foo = importlib.util.module_from_spec(spec) # type: ignore[attr-defined]
spec = importlib.util.spec_from_file_location("custom_check", check_file)
foo = importlib.util.module_from_spec(spec)
sys.modules["custom_check"] = foo
spec.loader.exec_module(foo)
for obj in dir(foo):
Expand Down

0 comments on commit 294a9b1

Please sign in to comment.