10BC0 chore: add exec_seconds attribute to ExecutionMetrics by Genesis929 · Pull Request #1104 · googleapis/python-bigquery-dataframes · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@Genesis929
Copy link
Collaborator

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #<issue_number_goes_here> 🦕

@product-auto-label product-auto-label bot added size: s Pull request size is small. api: bigquery Issues related to the googleapis/python-bigquery-dataframes API. labels Oct 22, 2024
@Genesis929 Genesis929 marked this pull request as ready for review October 22, 2024 21:58
@Genesis929 Genesis929 requested review from a team as code owners October 22, 2024 21:58
@Genesis929 Genesis929 requested a review from shobsi October 22, 2024 21:58
if query_job.created is not None and query_job.ended is not None:
execution_secs = (query_job.ended - query_job.created).total_seconds()
else:
return None
Copy link
Contributor

Choose a reason for hiding this comment

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

there are multiple return None statements which makes it a bit hard to follow. Can we do it only once in the beginning if query_job.state != "DONE", otherwise always return a legit tuple?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Seems query_job.state != "DONE" does not guarantee the metrics exist for case like mocks and dry_run, so maybe this is more reliable.

@Genesis929 Genesis929 requested a review from shobsi November 6, 2024 19:57
@Genesis929 Genesis929 merged commit 65e2e70 into main Nov 6, 2024
13 checks passed
@Genesis929 Genesis929 deleted the add_exec_metric_huanc branch November 6, 2024 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: bigquery Issues related to the googleapis/python-bigquery-dataframes API. size: s Pull request size is small.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

0