Skip to content

Commit 0e533cf

Browse files
committed
Fix manifest object handling in executor hook logging
1 parent 07b97fd commit 0e533cf

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

src/datapilot/core/platforms/dbt/hooks/executor_hook.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,23 @@ def main(argv: Optional[Sequence[str]] = None):
150150
try:
151151
print("Generating partial manifest and catalog from changed files...", file=sys.stderr)
152152
selected_models, manifest, catalog = generate_partial_manifest_catalog(changed_files, base_path=base_path)
153-
print(f"Generated manifest with {len(manifest.get('nodes', {}))} nodes", file=sys.stderr)
153+
154+
# Handle manifest object (could be ManifestV12 or similar)
155+
if hasattr(manifest, "nodes"):
156+
print(f"Generated manifest with {len(manifest.nodes)} nodes", file=sys.stderr)
157+
elif hasattr(manifest, "get") and callable(manifest.get):
158+
print(f"Generated manifest with {len(manifest.get('nodes', {}))} nodes", file=sys.stderr)
159+
else:
160+
print(f"Generated manifest object of type: {type(manifest).__name__}", file=sys.stderr)
161+
162+
# Handle catalog object (could be CatalogV1 or similar)
154163
if catalog:
155-
print(f"Generated catalog with {len(catalog.get('nodes', {}))} nodes", file=sys.stderr)
164+
if hasattr(catalog, "nodes"):
165+
print(f"Generated catalog with {len(catalog.nodes)} nodes", file=sys.stderr)
166+
elif hasattr(catalog, "get") and callable(catalog.get):
167+
print(f"Generated catalog with {len(catalog.get('nodes', {}))} nodes", file=sys.stderr)
168+
else:
169+
print(f"Generated catalog object of type: {type(catalog).__name__}", file=sys.stderr)
156170
else:
157171
print("No catalog generated (catalog file not available)", file=sys.stderr)
158172

0 commit comments

Comments
 (0)