Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

show: Added --add-feature-count-estimate #1039

Merged
merged 1 commit into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ _When adding new entries to the changelog, please include issue/PR numbers where

## Unreleased

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

## 0.16.1

Expand Down
12 changes: 12 additions & 0 deletions kart/show.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,16 @@
"Otherwise, the feature count will be approximated with varying levels of accuracy."
),
)
@click.option(
"--add-feature-count-estimate",
default=None,
type=click.Choice(diff_estimation.ACCURACY_CHOICES),
help=(
"Adds a feature count estimate to this diff (used with `--output-format json-lines` only.) "
"The estimate will be calculated while the diff is being generated, and will be added to "
"the stream when it is ready. If the estimate is not ready before the process exits, it will not be added."
),
)
@click.option(
"--diff-files",
is_flag=True,
Expand Down Expand Up @@ -109,6 +119,7 @@ def show(
output_path,
exit_code,
only_feature_count,
add_feature_count_estimate,
diff_files,
args,
diff_format=DiffFormat.FULL,
Expand Down Expand Up @@ -161,6 +172,7 @@ def show(
delta_filter=delta_filter,
target_crs=crs,
sort_keys=sort_keys,
diff_estimate_accuracy=add_feature_count_estimate,
)
diff_writer.full_file_diffs(diff_files)
diff_writer.include_target_commit_as_header()
Expand Down
Loading