Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Update to use the latest EDK API #19

Merged
merged 2 commits into from
Jan 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions dbt_ext/extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand Down
26 changes: 12 additions & 14 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.