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

fix: dbt-external-tables partitions #54

Closed
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
5 changes: 5 additions & 0 deletions dbt_dry_run/models/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,16 @@ class ManifestColumn(BaseModel):
class ExternalConfig(BaseModel):
location: str
dry_run_columns: List[ManifestColumn] = Field(default_factory=lambda: list())
partitions: List[ManifestColumn] = Field(default_factory=lambda: list())

@property
def dry_run_columns_map(self) -> Dict[str, ManifestColumn]:
return {c.name: c for c in self.dry_run_columns}

@property
def partitions_map(self) -> Dict[str, ManifestColumn]:
return {c.name: c for c in self.partitions}


class Node(BaseModel):
name: str
Expand Down
2 changes: 1 addition & 1 deletion dbt_dry_run/node_runner/source_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def run(self, node: Node) -> DryRunResult:
columns_to_map = (
external_config.dry_run_columns_map
if external_config.dry_run_columns
else node.columns
else {**external_config.partitions_map, **node.columns}
)
predicted_table = map_columns_to_table(columns_to_map)
except (InvalidColumnSpecification, UnknownDataTypeException) as e:
Expand Down
Loading