-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
[core] fix worker launch time formatting #43516
Conversation
python/ray/util/state/common.py
Outdated
@@ -93,6 +93,15 @@ def timestamp(x: float): | |||
"""Converts miliseconds to a datetime object.""" | |||
return str(datetime.datetime.fromtimestamp(x / 1000)) | |||
|
|||
def timestamp_or_empty(x: int): |
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.
Does it make sense to unify timestamp_or_empty
and timestamp
into a single method that can take either float or int, valid values and invalid values?
This way user does not need to decide which exact method to call.
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.
fixed
@hongchaodeng this PR still relevant; couple feedback points waiting on you. |
bcce315
to
37f9fbb
Compare
Signed-off-by: hongchaodeng <[email protected]>
37f9fbb
to
8e55004
Compare
python/ray/util/state/common.py
Outdated
if x == -1: | ||
return "" |
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 think we should do it on the caller side as the caller knows what special value can be so that this method doesn't need to handle -1, None or some other special values
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.
fixed
Signed-off-by: hongchaodeng <[email protected]>
e95b6a8
to
fcb37a4
Compare
Why are these changes needed?
Timestamp was not set for when triggering the launcher, resulting in default timestamp being set as (int) -1 == (unsigned) 18446744073709551615 (2^64-1)
Related issue number
Closes #35130
Checks
git commit -s
) in this PR.scripts/format.sh
to lint the changes in this PR.method in Tune, I've added it in
doc/source/tune/api/
under thecorresponding
.rst
file.