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

Equality testing for objects in the object store #341

Open
pcmoritz opened this issue Aug 2, 2016 · 1 comment
Open

Equality testing for objects in the object store #341

pcmoritz opened this issue Aug 2, 2016 · 1 comment

Comments

@pcmoritz
Copy link
Collaborator

pcmoritz commented Aug 2, 2016

Objects a and b that are retrieved by ray.get have two additional fields (ray_deallocator and ray_objectid), which means they cannot be compared for equality.

The underlying issue is similar to #331

@pcmoritz
Copy link
Collaborator Author

pcmoritz commented Aug 2, 2016

As a workaround, this can be used:

from numpy.testing import assert_equal

def ray_assert_equal(a, b, attrs=[]):
  attrs.extend(["ray_deallocator", "ray_objectid"])
  a = a.__dict__
  b = b.__dict__
  A = dict((i, a[i]) for i in a if i not in attrs)
  B = dict((i, b[i]) for i in b if i not in attrs)
  assert_equal(A, B)

It compares member of a python object, except for ray_deallocator and ray_objectid; note that testing is not done recursively (it will fail if one of the members is a non-primitive python object). Recursive testing can be done with https://gist.github.com/samuraisam/901117.

pcmoritz pushed a commit to pcmoritz/ray that referenced this issue Dec 18, 2017
* Compile the Ray redis module with C++.

* Redo parsing of object table notifications with flatbuffers.

* Update redis module python tests.

* Redo parsing of task table notifications with flatbuffers.

* Fix linting.

* Redo parsing of db client notifications with flatbuffers.

* Redo publishing of local scheduler heartbeats with flatbuffers.

* Fix linting.

* Remove usage of fixed-width formatting of scheduling state in channel name.

* Reply with flatbuffer object to task table queries, also simplify redis string to flatbuffer string conversion.

* Fix linting and tests.

* fix

* cleanup

* simplify logic in ReplyWithTask
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

No branches or pull requests

1 participant