Skip to content

Commit 943e87a

Browse files
authored
Merge pull request #1039 from koordinates/show-add-feature-count-estimate
show: Added `--add-feature-count-estimate`
2 parents 7fef415 + 631c498 commit 943e87a

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ _When adding new entries to the changelog, please include issue/PR numbers where
66

77
## Unreleased
88

9+
- diff/show: Faster output for some large repositories (varies wildly) [#1038](https://github.com/koordinates/kart/issues/1038)
910
- show: Added `--no-sort-keys` option to disable sorting of features by name/PK. Previously added to `diff` only
11+
- show: Added `--add-feature-count-estimate` option to add a feature count estimate to `json-lines` output. Previously added to `diff` only
1012

1113
## 0.16.1
1214

kart/show.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,16 @@
6565
"Otherwise, the feature count will be approximated with varying levels of accuracy."
6666
),
6767
)
68+
@click.option(
69+
"--add-feature-count-estimate",
70+
default=None,
71+
type=click.Choice(diff_estimation.ACCURACY_CHOICES),
72+
help=(
73+
"Adds a feature count estimate to this diff (used with `--output-format json-lines` only.) "
74+
"The estimate will be calculated while the diff is being generated, and will be added to "
75+
"the stream when it is ready. If the estimate is not ready before the process exits, it will not be added."
76+
),
77+
)
6878
@click.option(
6979
"--diff-files",
7080
is_flag=True,
@@ -109,6 +119,7 @@ def show(
109119
output_path,
110120
exit_code,
111121
only_feature_count,
122+
add_feature_count_estimate,
112123
diff_files,
113124
args,
114125
diff_format=DiffFormat.FULL,
@@ -161,6 +172,7 @@ def show(
161172
delta_filter=delta_filter,
162173
target_crs=crs,
163174
sort_keys=sort_keys,
175+
diff_estimate_accuracy=add_feature_count_estimate,
164176
)
165177
diff_writer.full_file_diffs(diff_files)
166178
diff_writer.include_target_commit_as_header()

0 commit comments

Comments
 (0)