Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gaurpulkit committed May 31, 2024
1 parent 9245187 commit ec7401d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
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
11 changes: 4 additions & 7 deletions src/datapilot/core/platforms/dbt/schemas/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,13 @@ class DBTVersion(BaseModel):


class AltimateDocs(BaseModel):
class Config:
extra = Extra.forbid

show: Optional[bool] = True
node_color: Optional[Optional[str]] = None
node_color: Optional[str] = None


class AltimateDependsOn(BaseModel):
nodes: Optional[List[str]]
macros: Optional[List[str]]
nodes: Optional[List[str]] = None
macros: Optional[List[str]] = None


class AltimateManifestColumnInfo(BaseModel):
Expand Down Expand Up @@ -165,7 +162,7 @@ class AltimateManifestNode(BaseModel):
compiled_path: Optional[Optional[str]] = None
compiled: Optional[bool] = False
compiled_code: Optional[Optional[str]] = None
access: Optional[AltimateAccess]
access: Optional[AltimateAccess] = "protected"
contract: Optional[AltimateDBTContract] = None
meta: Optional[Dict[str, Any]] = None
patch_path: Optional[Optional[str]] = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from datapilot.core.platforms.dbt.constants import SINGULAR
from datapilot.core.platforms.dbt.schemas.manifest import AltimateDBTContract
from datapilot.core.platforms.dbt.schemas.manifest import AltimateDependsOn
from datapilot.core.platforms.dbt.schemas.manifest import AltimateDocs
from datapilot.core.platforms.dbt.schemas.manifest import AltimateExposureType
from datapilot.core.platforms.dbt.schemas.manifest import AltimateExternalTable
from datapilot.core.platforms.dbt.schemas.manifest import AltimateFileHash
Expand Down Expand Up @@ -175,7 +176,7 @@ def _get_macro(self, macro: MacroNode) -> AltimateManifestMacroNode:
),
description=macro.description,
meta=macro.meta,
docs=macro.docs,
docs=AltimateDocs(show=macro.docs.show, node_color=macro.docs.node_color) if macro.docs else None,
patch_path=macro.patch_path,
arguments=[AltimateMacroArgument(**arg.dict()) for arg in macro.arguments] if macro.arguments else None,
created_at=macro.created_at,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from datapilot.core.platforms.dbt.constants import SINGULAR
from datapilot.core.platforms.dbt.schemas.manifest import AltimateDBTContract
from datapilot.core.platforms.dbt.schemas.manifest import AltimateDependsOn
from datapilot.core.platforms.dbt.schemas.manifest import AltimateDocs
from datapilot.core.platforms.dbt.schemas.manifest import AltimateExposureType
from datapilot.core.platforms.dbt.schemas.manifest import AltimateExternalTable
from datapilot.core.platforms.dbt.schemas.manifest import AltimateFileHash
Expand Down Expand Up @@ -175,7 +176,7 @@ def _get_macro(self, macro: MacroNode) -> AltimateManifestMacroNode:
),
description=macro.description,
meta=macro.meta,
docs=macro.docs,
docs=AltimateDocs(show=macro.docs.show, node_color=macro.docs.node_color) if macro.docs else None,
patch_path=macro.patch_path,
arguments=[AltimateMacroArgument(**arg.dict()) for arg in macro.arguments] if macro.arguments else None,
created_at=macro.created_at,
Expand Down

0 comments on commit ec7401d

Please sign in to comment.