diff --git a/core/dbt/main.py b/core/dbt/main.py index 511e092a7e5..a99e14dc24c 100644 --- a/core/dbt/main.py +++ b/core/dbt/main.py @@ -640,6 +640,14 @@ def _build_source_snapshot_freshness_subparser(subparsers, base_subparser): target/sources.json """ ) + sub.add_argument( + '--threads', + type=int, + required=False, + help=""" + Specify number of threads to use. Overrides settings in profiles.yml + """ + ) sub.set_defaults(cls=freshness_task.FreshnessTask, which='snapshot-freshness') return sub diff --git a/core/dbt/node_runners.py b/core/dbt/node_runners.py index 4c988bb0165..b269791ea21 100644 --- a/core/dbt/node_runners.py +++ b/core/dbt/node_runners.py @@ -400,6 +400,7 @@ def from_run_result(self, result, start_time, timing_info): def execute(self, compiled_node, manifest): relation = self.adapter.Relation.create_from_source(compiled_node) # given a Source, calculate its fresnhess. + self.adapter.clear_transaction(compiled_node.unique_id) freshness = self.adapter.calculate_freshness( relation, compiled_node.loaded_at_field,