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

Instancing a PCC object is allowed but fails on null primary key #69

Open
arthur00 opened this issue Aug 24, 2016 · 1 comment
Open
Labels

Comments

@arthur00
Copy link
Member

I accidentally created a subset object (e.g. ActiveCar() instead of Car()) and I got an error message indicating the object had no '_ID' attribute when trying to add it to frame (frame.add(ActiveCar())).

Raises two issues: 1) This is not a good error message to have; 2) Should I be allowed to instance a pcc type? If I am, spacetime should at least reject attempts to add it to frame.

  File "/Users/arthurvaladares/Dropbox/workspace/spacetime/python/spacetime_local/frame.py", line 338, in add
    self.object_store.insert(obj)
  File "/Users/arthurvaladares/Dropbox/workspace/spacetime/python/spacetime_local/store.py", line 56, in insert
    self._changes["new"].setdefault(obj.Class(), RecursiveDictionary()).setdefault(obj.__primarykey__, RecursiveDictionary()).rec_update(objjson)
  File "/Users/arthurvaladares/Dropbox/workspace/spacetime/python/datamodel/benchmark/datamodel.py", line 19, in ID
    return self._ID
AttributeError: '_Subset' object has no attribute '_ID'
@arthur00 arthur00 added the bug label Aug 24, 2016
@arthur00
Copy link
Member Author

On another note, we should also disallow a simulation being a producer of pcc types like subsets and joins, that would make no sense ( right?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant