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

Commit b2b079c

Browse files
committed
Fix parity between CLI and diff_tables(): Rename '--materialize' to '--materialize-to-table' + more
1 parent 854e06e commit b2b079c

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

data_diff/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from .hashdiff_tables import HashDiffer, DEFAULT_BISECTION_THRESHOLD, DEFAULT_BISECTION_FACTOR
88
from .joindiff_tables import JoinDiffer, TABLE_WRITE_LIMIT
99
from .table_segment import TableSegment
10+
from .utils import eval_name_template
1011

1112
__version__ = "0.3.0rc4"
1213

@@ -152,7 +153,7 @@ def diff_tables(
152153
)
153154
elif algorithm == Algorithm.JOINDIFF:
154155
if isinstance(materialize_to_table, str):
155-
materialize_to_table = table1.database.parse_table_name(materialize_to_table)
156+
materialize_to_table = table1.database.parse_table_name(eval_name_template(materialize_to_table))
156157
differ = JoinDiffer(
157158
threaded=threaded,
158159
max_threadpool_size=max_threadpool_size,

data_diff/__main__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def write_usage(self, prog: str, args: str = "", prefix: Optional[str] = None) -
123123
)
124124
@click.option(
125125
"-m",
126-
"--materialize",
126+
"--materialize-to-table",
127127
default=None,
128128
metavar="TABLE_NAME",
129129
help="(joindiff only) Materialize the diff results into a new table in the database. If a table exists by that name, it will be replaced.",
@@ -248,7 +248,7 @@ def _main(
248248
sample_exclusive_rows,
249249
materialize_all_rows,
250250
table_write_limit,
251-
materialize,
251+
materialize_to_table,
252252
threads1=None,
253253
threads2=None,
254254
__conf__=None,
@@ -344,7 +344,7 @@ def _main(
344344
sample_exclusive_rows=sample_exclusive_rows,
345345
materialize_all_rows=materialize_all_rows,
346346
table_write_limit=table_write_limit,
347-
materialize_to_table=materialize and db1.parse_table_name(eval_name_template(materialize)),
347+
materialize_to_table=materialize_to_table and db1.parse_table_name(eval_name_template(materialize_to_table)),
348348
)
349349
else:
350350
assert algorithm == Algorithm.HASHDIFF

0 commit comments

Comments
 (0)