-
Notifications
You must be signed in to change notification settings - Fork 48
chore: add exec_seconds attribute to ExecutionMetrics #1104
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
Conversation
bigframes/session/metrics.py
Outdated
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
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:
Fixes #<issue_number_goes_here> 🦕