Skip to content

skip counting results for mvt tiles - #288

Merged
apeters merged 4 commits into
mainfrom
adg/mvt-skip-search-count
Nov 11, 2026
Merged

apeters merged 4 commits into
mainfrom
adg/mvt-skip-search-count

Conversation

@aarongundel

Copy link
Copy Markdown
Contributor

No description provided.

@aarongundel
aarongundel marked this pull request as ready for review November 10, 2026 17:32
@aarongundel
aarongundel requested a review from apeters November 10, 2026 17:32

@chrabyrd chrabyrd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overall looks good! just some minor nits really

Comment thread arches_search/utils/search/compiler.py Resolved
Comment thread arches_search/utils/search/compiler.py Resolved
@aarongundel
aarongundel requested a review from chrabyrd November 10, 2026 20:50

@chrabyrd chrabyrd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! thanks for getting those changes in

@apeters apeters left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One question: should .compile_without_counts return a SearchResult object like .compile currently does, for consistencies sake? Right now the former returns a queryset, while the latter returns a SearchResult object.

Or maybe we just have the single compile method that can take an optional argument that returns no counts. EG: .compile(return_counts=False)

curious to hear what @chrabyrd has to say about this

@chrabyrd

Copy link
Copy Markdown
Contributor

One question: should .compile_without_counts return a SearchResult object like .compile currently does, for consistencies sake? Right now the former returns a queryset, while the latter returns a SearchResult object.

Or maybe we just have the single compile method that can take an optional argument that returns no counts. EG: .compile(return_counts=False)

curious to hear what @chrabyrd has to say about this

yeah I actually quite like the flag idea:

def compile(self, return_counts: bool = True) -> SearchResult:
    requested_graphs = self._requested_graphs()
    if not requested_graphs:
        matches = self._base_resources().none()
    else:
        matches = self._permitted_matches(requested_graphs)
    if not return_counts:
        return SearchResult(results=matches)
    counts_by_graph_id = _counts_by_graph_id(matches)
    return SearchResult(
        results=matches,
        scoped_count=sum(counts_by_graph_id.values()),
        resource_type_counts=_resource_type_counts(requested_graphs, counts_by_graph_id),
    )

does that sound alright to you @aarongundel ?

@aarongundel

Copy link
Copy Markdown
Contributor Author

I dig it - it's in.

@apeters apeters left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@apeters
apeters merged commit d67913c into main Nov 11, 2026
6 checks passed
@chiatt
chiatt deleted the adg/mvt-skip-search-count branch November 24, 2026 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants