Skip to content

Commit

Permalink
add sources only if available (#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
armaandhull authored Dec 7, 2023
1 parent ede5a68 commit 784fa82
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/dbt_osmosis/core/osmosis.py
Original file line number Diff line number Diff line change
Expand Up @@ -686,10 +686,10 @@ def commit_project_restructure_to_disk(
target_schema = {"version": 2}
elif "version" not in target_schema:
target_schema["version"] = 2
# Add models and sources to target schema
# Add models and sources (if available) to target schema
if structure.output["models"]:
target_schema.setdefault("models", []).extend(structure.output["models"])
if structure.output["sources"]:
if structure.output.get("sources") is not None:
target_schema.setdefault("sources", []).extend(structure.output["sources"])
if not self.dry_run:
self.yaml_handler.dump(target_schema, target)
Expand Down

0 comments on commit 784fa82

Please sign in to comment.