Skip to content

Commit

Permalink
dbt: use more modern entry_points, update supported manifest versions (
Browse files Browse the repository at this point in the history
…OpenLineage#3278)

Signed-off-by: Maciej Obuchowski <[email protected]>
  • Loading branch information
mobuchowski authored Dec 2, 2024
1 parent 185213c commit 6b8f7ad
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
8 changes: 4 additions & 4 deletions integration/common/openlineage/common/provider/dbt/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,8 @@ def load_metadata(
if schema_version > max(desired_schema_versions):
logger.warning(
f"Artifact schema version: {str_schema_version} is above dbt-ol "
f"supported version {max(desired_schema_versions)}. "
f"This might cause errors."
f"tested version {max(desired_schema_versions)}. "
f"Newer versions have not been tested and may not be compatible."
)
else:
raise ValueError(
Expand Down Expand Up @@ -243,9 +243,9 @@ def load_yaml_with_jinja(self, path: str) -> Dict:
def get_dbt_metadata(
self,
) -> Tuple[Dict[Any, Any], Dict[Any, Any], Dict[Any, Any], Optional[Dict[Any, Any]]]:
manifest = self.load_metadata(self.manifest_path, [2, 3, 4, 5, 6, 7], self.logger)
manifest = self.load_metadata(self.manifest_path, list(range(2, 13)), self.logger)

run_result = self.load_metadata(self.run_result_path, [2, 3, 4, 5, 6], self.logger)
run_result = self.load_metadata(self.run_result_path, list(range(2, 7)), self.logger)

try:
catalog: Optional[Dict[Any, Any]] = self.load_metadata(self.catalog_path, [1], self.logger)
Expand Down
2 changes: 1 addition & 1 deletion integration/common/tests/dbt/test_dbt_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def test_logging_handler_warns():

logger.warning.assert_called_once_with(
"Artifact schema version: https://schemas.getdbt.com/dbt/manifest/v2.json is above "
"dbt-ol supported version 1. This might cause errors."
"dbt-ol tested version 1. Newer versions have not been tested and may not be compatible."
)


Expand Down
File renamed without changes.
11 changes: 6 additions & 5 deletions integration/dbt/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
#
# Copyright 2018-2024 contributors to the OpenLineage project
# SPDX-License-Identifier: Apache-2.0
#
# -*- coding: utf-8 -*-

from setuptools import setup
from setuptools import find_namespace_packages, setup

with open("README.md") as readme_file:
readme = readme_file.read()
Expand All @@ -19,7 +17,7 @@


extras_require = {
"tests": ["pytest", "pytest-cov", "mock", "ruff" "mypy>=0.9.6", "python-dateutil"],
"tests": ["pytest", "pytest-cov", "mock", "ruff", "mypy>=0.9.6", "python-dateutil"],
}
extras_require["dev"] = set(sum(extras_require.values(), []))

Expand All @@ -30,7 +28,10 @@
long_description=readme,
long_description_content_type="text/markdown",
author="OpenLineage",
scripts=["scripts/dbt-ol"],
packages=find_namespace_packages(include=["openlineage.*"]),
entry_points={
"console_scripts": ["dbt-ol = openlineage.dbt:main"],
},
include_package_data=True,
install_requires=requirements,
extras_require=extras_require,
Expand Down

0 comments on commit 6b8f7ad

Please sign in to comment.