Skip to content

Commit

Permalink
feat: add dbt v1.8 support without pydantic v2 (#39)
Browse files Browse the repository at this point in the history
* add dbt v1.8 support without pydantic v2

* change version
  • Loading branch information
gaurpulkit authored Jun 14, 2024
1 parent e3c43da commit 47456d3
Show file tree
Hide file tree
Showing 8 changed files with 467 additions and 1 deletion.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def read(*names, **kwargs):
python_requires=">=3.8",
install_requires=[
"click==8.1.7",
"dbt-artifacts-parser==0.5.1",
"dbt-artifacts-parser==0.6.0",
"ruamel.yaml==0.18.6",
"tabulate==0.9.0",
"requests==2.31.0",
Expand Down
4 changes: 4 additions & 0 deletions src/datapilot/core/platforms/dbt/factory.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
from dbt_artifacts_parser.parsers.catalog.catalog_v1 import CatalogV1
from dbt_artifacts_parser.parsers.manifest.manifest_v10 import ManifestV10
from dbt_artifacts_parser.parsers.manifest.manifest_v11 import ManifestV11
from dbt_artifacts_parser.parsers.manifest.manifest_v12 import ManifestV12

from datapilot.core.platforms.dbt.schemas.manifest import Catalog
from datapilot.core.platforms.dbt.schemas.manifest import Manifest
from datapilot.core.platforms.dbt.wrappers.catalog.v1.wrapper import CatalogV1Wrapper
from datapilot.core.platforms.dbt.wrappers.manifest.v10.wrapper import ManifestV10Wrapper
from datapilot.core.platforms.dbt.wrappers.manifest.v11.wrapper import ManifestV11Wrapper
from datapilot.core.platforms.dbt.wrappers.manifest.v12.wrapper import ManifestV12Wrapper
from datapilot.exceptions.exceptions import AltimateNotSupportedError


class DBTFactory:
@classmethod
def get_manifest_wrapper(cls, manifest: Manifest):
if isinstance(manifest, ManifestV12):
return ManifestV12Wrapper(manifest)
if isinstance(manifest, ManifestV11):
return ManifestV11Wrapper(manifest)
if isinstance(manifest, ManifestV10):
Expand Down
Empty file.
36 changes: 36 additions & 0 deletions src/datapilot/core/platforms/dbt/wrappers/manifest/v12/schemas.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
from typing import Dict
from typing import Type
from typing import Union

from dbt_artifacts_parser.parsers.manifest.manifest_v12 import Exposures
from dbt_artifacts_parser.parsers.manifest.manifest_v12 import Macros
from dbt_artifacts_parser.parsers.manifest.manifest_v12 import Node
from dbt_artifacts_parser.parsers.manifest.manifest_v12 import Node1
from dbt_artifacts_parser.parsers.manifest.manifest_v12 import Node2
from dbt_artifacts_parser.parsers.manifest.manifest_v12 import Node3
from dbt_artifacts_parser.parsers.manifest.manifest_v12 import Node4
from dbt_artifacts_parser.parsers.manifest.manifest_v12 import Node5
from dbt_artifacts_parser.parsers.manifest.manifest_v12 import Node6
from dbt_artifacts_parser.parsers.manifest.manifest_v12 import Node7
from dbt_artifacts_parser.parsers.manifest.manifest_v12 import Sources

from datapilot.core.platforms.dbt.constants import GENERIC
from datapilot.core.platforms.dbt.constants import SINGULAR

ManifestNode = Union[Node, Node1, Node2, Node3, Node4, Node5, Node6, Node7]

SourceNode = Sources

ExposureNode = Exposures

TestNode = Union[Node6, Node2]

MacroNode = Macros

TEST_TYPE_TO_NODE_MAP: Dict[str, Type] = {
GENERIC: [Node6],
SINGULAR: [Node2],
}


SeedNodeMap = Node
Loading

0 comments on commit 47456d3

Please sign in to comment.