Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.

Commit a75c2c9

Browse files
committed
feat: add --stats flag to --dbt
1 parent edaf565 commit a75c2c9

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

data_diff/__main__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,7 @@ def main(conf, run, **kw):
317317
json_output=kw["json_output"],
318318
state=state,
319319
where_flag=kw["where"],
320+
stats_flag=kw["stats"],
320321
)
321322
else:
322323
return _data_diff(

data_diff/dbt.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ class TDiffVars(pydantic.BaseModel):
6060
include_columns: List[str]
6161
exclude_columns: List[str]
6262
dbt_model: Optional[str] = None
63+
stats_flag: bool = False
6364

6465

6566
def dbt_diff(
@@ -71,6 +72,7 @@ def dbt_diff(
7172
state: Optional[str] = None,
7273
log_status_handler: Optional[LogStatusHandler] = None,
7374
where_flag: Optional[str] = None,
75+
stats_flag: bool = False,
7476
) -> None:
7577
print_version_info()
7678
diff_threads = []
@@ -110,7 +112,7 @@ def dbt_diff(
110112
if log_status_handler:
111113
log_status_handler.set_prefix(f"Diffing {model.alias} \n")
112114

113-
diff_vars = _get_diff_vars(dbt_parser, config, model, where_flag)
115+
diff_vars = _get_diff_vars(dbt_parser, config, model, where_flag, stats_flag)
114116

115117
# we won't always have a prod path when using state
116118
# when the model DNE in prod manifest, skip the model diff
@@ -160,6 +162,7 @@ def _get_diff_vars(
160162
config: TDatadiffConfig,
161163
model,
162164
where_flag: Optional[str] = None,
165+
stats_flag: bool = False,
163166
) -> TDiffVars:
164167
dev_database = model.database
165168
dev_schema = model.schema_
@@ -193,6 +196,7 @@ def _get_diff_vars(
193196
where_filter=where_flag or datadiff_model_config.where_filter,
194197
include_columns=datadiff_model_config.include_columns,
195198
exclude_columns=datadiff_model_config.exclude_columns,
199+
stats_flag=stats_flag,
196200
)
197201

198202

0 commit comments

Comments
 (0)