-
Notifications
You must be signed in to change notification settings - Fork 549
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
Handle null usage intervals in duration computing #1680
Handle null usage intervals in duration computing #1680
Conversation
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.
Thanks for the quick fix @sumanthgenz! Left two comments.
sky/global_user_state.py
Outdated
@@ -426,11 +426,16 @@ def _get_cluster_launch_time(cluster_hash: str) -> Optional[Dict[str, Any]]: | |||
|
|||
|
|||
def _get_cluster_duration(cluster_hash: str) -> Optional[Dict[str, Any]]: |
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.
should we update the return value type hint?
sky/global_user_state.py
Outdated
if start_time is None: | ||
continue |
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.
In what case will the start_time
be None
? Worth adding a comment for this.
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.
I guess there is no specific case where this would happen, so I can remove this logic
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.
Thanks for the quick fix @sumanthgenz! LGTM. Due to the GitHub CI changes, please merge the master branch and push again to enable the PR merge.
2fcb9e6
to
8269594
Compare
* handle null usage intervals in duration computing * pr changes --------- Co-authored-by: Sumanth <sumanth@MacBook-Pro-5.local>
* handle null usage intervals in duration computing * pr changes --------- Co-authored-by: Sumanth <sumanth@MacBook-Pro-5.local>
For clusters that are very old and have no history due to being present before changes to
cluster_history
tracking forsky cost-report
, we return zero duration and cost as a form of error-handling.Tested (run the relevant ones):
Simulated null usage intervals and start times and triggered the error-handling as seen below: