Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: search statistics#1616

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
chalmerlowe merged 56 commits intomainfromfeat-search-statistics
Sep 2, 2023
Merged

feat: search statistics#1616

chalmerlowe merged 56 commits intomainfromfeat-search-statistics
Sep 2, 2023

Conversation

@chalmerlowe
Copy link
Collaborator

Adds a feature to display search statistics in support of the following customer request:https://buganizer.corp.google.com/issues/290679162

Includes several classes to encapsulate the data found here:
https://cloud.google.com/bigquery/docs/reference/rest/v2/Job#searchstatistics

Also includes a function to access the data in the classes.

@chalmerlowechalmerlowe requested review froma team ascode ownersJuly 20, 2023 10:26
@product-auto-labelproduct-auto-labelbot added size: sPull request size is small. api: bigqueryIssues related to the googleapis/python-bigquery API. labelsJul 20, 2023
@shollymanshollyman requested review fromshollyman and removed request forfarhan0102July 20, 2023 15:57
Copy link
Contributor

@shollymanshollyman left a comment

Choose a reason for hiding this comment

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

Good start on the basic structure. This is an output-only stat so no need for a setter, but we'll need all the unit testing and a similar IT test to java using a query that invokes thesearch() sql function.

"""docstring"""

stats=self._job_statistics().get("searchStatistics")
returnSearchStats.from_api_repr(stats)
Copy link
Contributor

Choose a reason for hiding this comment

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

need to handle the not-present case, e.g.if stats is not None:


@classmethod
deffrom_api_repr(cls,stats:Dict[str,Any]):
mode=stats.get("indexUsageMode","INDEX_USAGE_MODE_UNSPECIFIED")
Copy link
Contributor

Choose a reason for hiding this comment

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

Generally, we want to avoid the library injecting values not present in the API response, so returning the default value here may not be more desirable than empty/none.

@product-auto-labelproduct-auto-labelbot added size: mPull request size is medium. and removed size: sPull request size is small. labelsAug 9, 2023
gcf-owl-botbotand others added10 commitsAugust 9, 2023 18:36
@chalmerlowechalmerlowe added kokoro:runAdd this label to force Kokoro to re-run the tests. kokoro:force-runAdd this label to force Kokoro to re-run the tests. labelsAug 23, 2023
@yoshi-kokoroyoshi-kokoro removed kokoro:runAdd this label to force Kokoro to re-run the tests. kokoro:force-runAdd this label to force Kokoro to re-run the tests. labelsAug 23, 2023
Copy link
Contributor

@shollymanshollyman left a comment

Choose a reason for hiding this comment

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

After some more reading, I think the attribute approach is sufficient vs explicit property annotations.

Main concern is about attribute defaults. Typically None is better when users are trying to disambiguate between presence of a value vs the empty value, but happy to talk about this more. Swapping the default impacts typing, unit tests, etc.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@shollymanshollymanshollyman approved these changes

Assignees

No one assigned

Labels

api: bigqueryIssues related to the googleapis/python-bigquery API.size: mPull request size is medium.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@chalmerlowe@shollyman@yoshi-kokoro

[8]ページ先頭

©2009-2025 Movatter.jp