Skip to content

Commit

Permalink
chore: add version printing
Browse files Browse the repository at this point in the history
  • Loading branch information
Vixtir committed Jul 14, 2023
1 parent cf7ffef commit 87dbe82
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
10 changes: 10 additions & 0 deletions odd_dbt/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from odd_dbt.logger import logger


def get_version() -> str:
try:
from odd_dbt.__version__ import VERSION
return VERSION
except ImportError:
logger.warning("Can't get version from odd_dbt.__version__")
return "0.0.0"
4 changes: 3 additions & 1 deletion odd_dbt/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from odd_models.api_client.v2.odd_api_client import Client
from oddrn_generator import DbtGenerator

from odd_dbt import get_version
from odd_dbt.context import DbtContext
from odd_dbt.logger import logger
from odd_dbt.mapper.dbt_test import DbtTestMapper
Expand All @@ -32,7 +33,8 @@ def test(
),
dbt_host: str = typer.Option(default="localhost"),
):
logger.info("Start dbt test process. Version: 0.1.21")
logger.info(f"Used OpenDataDiscovery dbt version: {get_version()}")
logger.info("Start dbt test process")
try:
logger.info(
f"Run dbt process with {project_dir=}, {profiles_dir=}, {target=}, {profile=}"
Expand Down

0 comments on commit 87dbe82

Please sign in to comment.