We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hello there,
When using the data argument to initialize the chest with a dict, it seems the inmemory dict does not get correctly initialized. Here is an example:
out = Chest(data={'id': set(), 'label': set()}) out2 = Chest() out2['id'] = set() out2['label'] = set() print(out.keys()) print(out2.keys()) Output: [] ['id', 'label']
When data is used, the keys are not available, as well as hasattr(out, 'id') will return False, but out['id'] will work and return set().
hasattr(out, 'id')
False
out['id']
set()
BTW, it is also not possible to update a chest with a simple dict:
out.update({'id': set([1, 2])}) Output: --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) <ipython-input-76-7a010f35ab01> in <module>() ----> 1 out.update({'id': set([1, 2])}) C:\git\centertbi-mri\libs\chest\core.py in update(self, other, overwrite) 290 # if already flushed, then this does nothing 291 self.flush() --> 292 other.flush() 293 for key in other._keys: 294 if key in self._keys and overwrite: AttributeError: 'dict' object has no attribute 'flush'
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hello there,
When using the
data
argument to initialize the chest with a dict, it seems the inmemory dict does not get correctly initialized. Here is an example:When
data
is used, the keys are not available, as well ashasattr(out, 'id')
will returnFalse
, butout['id']
will work and returnset()
.BTW, it is also not possible to update a chest with a simple dict:
The text was updated successfully, but these errors were encountered: