Skip to content
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

Coerce new TaskState.nbytes value to int #4311

Merged
merged 1 commit into from
Dec 3, 2020

Conversation

jakirkham
Copy link
Member

Make sure that whatever value we assign to nbytes is an int. This is important as Schedule.bandwidth may be a float. So the value here could be a float. Though we only measure nbytes in whole values.

Make sure that whatever value we assign to `nbytes` is an `int`. This is
important as `Schedule.bandwidth` may be a `float`. So the value here
could be a `float`. Though we only measure `nbytes` in whole values.
Copy link
Member

@jrbourbeau jrbourbeau left a comment

Choose a reason for hiding this comment

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

Thanks @jakirkham! This LGTM. Just wanted to point out that nbytes starts out as None

self.nbytes = None

Will that impact any Cython-related type checking?

@jakirkham
Copy link
Member Author

jakirkham commented Dec 3, 2020

It does, but we are already fixing that in PR ( #4302 ).

TL;DR We fix this by setting it to -1 and checking for negative values instead of None.

Copy link
Member

@jrbourbeau jrbourbeau left a comment

Choose a reason for hiding this comment

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

+1, thanks for the explanation @jakirkham

@jrbourbeau jrbourbeau merged commit 7ea9696 into dask:master Dec 3, 2020
@jakirkham jakirkham deleted the coerce_nbytes_to_int branch December 3, 2020 22:28
@jakirkham
Copy link
Member Author

Ofc. Thanks for the review! 😄

jakirkham added a commit to jakirkham/distributed that referenced this pull request Dec 3, 2020
Make sure that whatever value we assign to `nbytes` is an `int`. This is
important as `Schedule.bandwidth` may be a `float`. So the value here
could be a `float`. Though we only measure `nbytes` in whole values.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants