diff --git a/dbt_ext/extension.py b/dbt_ext/extension.py index 818ede7..484663c 100644 --- a/dbt_ext/extension.py +++ b/dbt_ext/extension.py @@ -6,12 +6,12 @@ import subprocess import sys from pathlib import Path -from typing import Any import structlog from meltano.edk import models from meltano.edk.extension import ExtensionBase from meltano.edk.process import Invoker, log_subprocess_error +from meltano.edk.types import ExecArg try: from importlib.resources import files as ir_files @@ -49,7 +49,7 @@ def __init__(self) -> None: os.getenv("DBT_EXT_SKIP_PRE_INVOKE", "false").lower() == "true" ) - def pre_invoke(self, invoke_name: str | None, *invoke_args: Any) -> None: + def pre_invoke(self, invoke_name: str | None, *invoke_args: ExecArg) -> None: """Pre-invoke hook. Runs `dbt deps` to ensure dependencies are up-to-date on every invocation. @@ -84,7 +84,7 @@ def pre_invoke(self, invoke_name: str | None, *invoke_args: Any) -> None: ) sys.exit(err.returncode) - def invoke(self, command_name: str | None, *command_args: Any) -> None: + def invoke(self, command_name: str | None, *command_args: ExecArg) -> None: """Invoke the underlying cli, that is being wrapped by this extension. Args: @@ -94,7 +94,7 @@ def invoke(self, command_name: str | None, *command_args: Any) -> None: try: command_msg = command_name if command_name else self.dbt_bin if len(command_args) > 0: - command_msg += f" {command_args[0][0]}" + command_msg += f" {command_args[0]}" log.info(f"Extension executing `{command_msg}`...") self.dbt_invoker.run_and_log(command_name, *command_args) except subprocess.CalledProcessError as err: diff --git a/poetry.lock b/poetry.lock index 8ef4d63..d665e8a 100644 --- a/poetry.lock +++ b/poetry.lock @@ -317,19 +317,19 @@ files = [] develop = false [package.dependencies] -devtools = "^0.10.0" -pydantic = "^1.10.4" +devtools = ">=0.9.0,<1" +pydantic = ">=1.9.0,<2" PyYAML = "^6.0.0" -structlog = "^22.3.0" +structlog = "^21" [package.extras] -docs = ["myst-parser (>=0.17.2,<0.19.0)", "sphinx (>=4.5,<6.0)", "sphinx-autobuild (>=2021.3.14,<2022.0.0)", "sphinx-copybutton (>=0.3.1,<0.6.0)", "sphinx-rtd-theme (>=0.5.2,<1.1.0)"] +docs = ["myst-parser (>=0.17.2,<0.19.0)", "sphinx (>=4.5,<6.0)", "sphinx-autobuild (>=2021.3.14,<2022.0.0)", "sphinx-copybutton (>=0.3.1,<0.6.0)", "sphinx-rtd-theme (>=0.5.2,<1.2.0)"] [package.source] type = "git" url = "https://github.com/meltano/edk.git" reference = "main" -resolved_reference = "19f57b7bbfe5476325abc5b7f55c64972b3c8b5c" +resolved_reference = "e5c3aa5fc23f61d153baaa1ae6ea9b572170eadc" [[package]] name = "mypy-extensions" @@ -616,25 +616,23 @@ files = [ [[package]] name = "structlog" -version = "22.3.0" +version = "21.5.0" description = "Structured Logging for Python" category = "main" optional = false -python-versions = ">=3.7" +python-versions = ">=3.6" files = [ - {file = "structlog-22.3.0-py3-none-any.whl", hash = "sha256:b403f344f902b220648fa9f286a23c0cc5439a5844d271fec40562dbadbc70ad"}, - {file = "structlog-22.3.0.tar.gz", hash = "sha256:e7509391f215e4afb88b1b80fa3ea074be57a5a17d794bd436a5c949da023333"}, + {file = "structlog-21.5.0-py3-none-any.whl", hash = "sha256:fd7922e195262b337da85c2a91c84be94ccab1f8fd1957bd6986f6904e3761c8"}, + {file = "structlog-21.5.0.tar.gz", hash = "sha256:68c4c29c003714fe86834f347cb107452847ba52414390a7ee583472bde00fc9"}, ] [package.dependencies] -importlib-metadata = {version = "*", markers = "python_version < \"3.8\""} typing-extensions = {version = "*", markers = "python_version < \"3.8\""} [package.extras] -dev = ["structlog[docs,tests,typing]"] -docs = ["furo", "myst-parser", "sphinx", "sphinx-notfound-page", "sphinxcontrib-mermaid", "twisted"] -tests = ["coverage[toml]", "freezegun (>=0.2.8)", "pretend", "pytest (>=6.0)", "pytest-asyncio (>=0.17)", "simplejson"] -typing = ["mypy", "rich", "twisted"] +dev = ["cogapp", "coverage[toml]", "freezegun (>=0.2.8)", "furo", "pre-commit", "pretend", "pytest (>=6.0)", "pytest-asyncio", "rich", "simplejson", "sphinx", "sphinx-notfound-page", "sphinxcontrib-mermaid", "tomli", "twisted"] +docs = ["furo", "sphinx", "sphinx-notfound-page", "sphinxcontrib-mermaid", "twisted"] +tests = ["coverage[toml]", "freezegun (>=0.2.8)", "pretend", "pytest (>=6.0)", "pytest-asyncio", "simplejson"] [[package]] name = "tomli"