Skip to content

Commit

Permalink
Merge pull request #2478 from fishtown-analytics/fix/source-patching-…
Browse files Browse the repository at this point in the history
…perf

fix source patching perf with no patches
  • Loading branch information
beckjake authored May 21, 2020
2 parents a8f8708 + e36fb3c commit 58f3905
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- The create_adapter_plugin.py script creates a version 2 dbt_project.yml file ([#2451](https://github.com/fishtown-analytics/dbt/issues/2451), [#2455](https://github.com/fishtown-analytics/dbt/pull/2455))
- Fixed dbt crashing with an AttributeError on duplicate sources ([#2463](https://github.com/fishtown-analytics/dbt/issues/2463), [#2464](https://github.com/fishtown-analytics/dbt/pull/2464))
- Fixed DBT Docker entrypoint ([#2470](https://github.com/fishtown-analytics/dbt/issues/2470), [#2475](https://github.com/fishtown-analytics/dbt/pull/2475))
- Fixed a performance regression that occurred even when a user was not using the relevant feature ([#2474](https://github.com/fishtown-analytics/dbt/issues/2474), [#2478](https://github.com/fishtown-analytics/dbt/pull/2478))

Contributors:
- [@dmateusp](https://github.com/dmateusp) ([#2475](https://github.com/fishtown-analytics/dbt/pull/2475))
Expand Down
5 changes: 3 additions & 2 deletions core/dbt/contracts/graph/model_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,9 @@ def update_from(
return self.from_dict(dct, validate=validate)

def finalize_and_validate(self: T) -> T:
self.to_dict(validate=True)
return self.replace()
# from_dict will validate for us
dct = self.to_dict(omit_none=False, validate=False)
return self.from_dict(dct)


@dataclass
Expand Down
2 changes: 2 additions & 0 deletions core/dbt/parser/sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ def patch_source(
unpatched: UnpatchedSourceDefinition,
patch: Optional[SourcePatch],
) -> UnpatchedSourceDefinition:
if patch is None:
return unpatched

source_dct = unpatched.source.to_dict()
table_dct = unpatched.table.to_dict()
Expand Down

0 comments on commit 58f3905

Please sign in to comment.