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

[Data] Fix mutable dataclass attribute #34339

Merged
merged 1 commit into from
Apr 18, 2023

Conversation

peytondmurray
Copy link
Contributor

@peytondmurray peytondmurray commented Apr 12, 2023

Why are these changes needed?

This PR fixes an instance where a mutable attribute is used as a dataclass member, which causes an exception. See this part of the docs for more information.

Related issue number

Possibly addresses #31225.

Checks

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
    • I've added any new APIs to the API Reference. For example, if I added a
      method in Tune, I've added it in doc/source/tune/api/ under the
      corresponding .rst file.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

@peytondmurray peytondmurray added the bug Something that is supposed to be working; but isn't label Apr 12, 2023
@peytondmurray peytondmurray changed the title [WIP] Fix mutable dataclass attribute Fix mutable dataclass attribute Apr 12, 2023
@peytondmurray peytondmurray marked this pull request as ready for review April 12, 2023 23:21
@amogkam amogkam self-assigned this Apr 12, 2023
Copy link
Contributor

@amogkam amogkam left a comment

Choose a reason for hiding this comment

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

thanks!

@peytondmurray peytondmurray changed the title Fix mutable dataclass attribute [Data] Fix mutable dataclass attribute Apr 14, 2023
@amogkam amogkam assigned ericl and c21 Apr 17, 2023
@c21
Copy link
Contributor

c21 commented Apr 18, 2023

Merging to master. Thanks @peytondmurray!

@c21 c21 merged commit 80db55b into ray-project:master Apr 18, 2023
@peytondmurray peytondmurray deleted the fix-default-factory branch April 18, 2023 00:21
elliottower pushed a commit to elliottower/ray that referenced this pull request Apr 22, 2023
This PR fixes an instance where a mutable attribute is used as a dataclass member, which causes an exception. See [this part of the docs](https://docs.python.org/3/library/dataclasses.html#mutable-default-values) for more information.

Signed-off-by: pdmurray <[email protected]>
Signed-off-by: elliottower <[email protected]>
ProjectsByJackHe pushed a commit to ProjectsByJackHe/ray that referenced this pull request May 4, 2023
This PR fixes an instance where a mutable attribute is used as a dataclass member, which causes an exception. See [this part of the docs](https://docs.python.org/3/library/dataclasses.html#mutable-default-values) for more information.

Signed-off-by: pdmurray <[email protected]>
Signed-off-by: Jack He <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that is supposed to be working; but isn't
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants