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
.add_fold
Code
db = superduper('mongomock://test_db') q = db['docs'].select().add_fold('train')
Output
--------------------------------------------------------------------------- ValueError Traceback (most recent call last) Cell In[6], line 1 ----> 1 db['docs'].select().add_fold('train') File ~/superduper-io/superduper/superduper/backends/base/query.py:35, in applies_to.<locals>.decorator.<locals>.decorated(self, *args, **kwargs) 33 raise TypeError(msg) 34 assert flavour in flavours, msg ---> 35 return f(self, *args, **kwargs) File ~/.pyenv/versions/3.11.7/envs/superduper-3.11/lib/python3.11/site-packages/superduper_mongodb/query.py:370, in MongoQuery.add_fold(self, fold) 364 @applies_to('find', 'find_one', 'select', 'outputs') 365 def add_fold(self, fold: str): 366 """Return a query that adds a fold to the query. 367 368 :param fold: The fold to add. 369 """ --> 370 return self.filter(self['_fold'] == fold) File ~/.pyenv/versions/3.11.7/envs/superduper-3.11/lib/python3.11/site-packages/superduper_mongodb/query.py:255, in MongoQuery.filter(self, *args, **kwargs) 253 continue 254 if not isinstance(arg, Query): --> 255 raise ValueError(f'Filter arguments must be queries, but got: {arg}') 256 assert len(arg.parts) > 1, f'Invalid filter query: {arg}' 257 key, (op, op_args, _) = arg.parts[-2:] ValueError: Filter arguments must be queries, but got: False In [7]: db['docs'].select() == 2 Out[7]: False In [8]: db['docs'].select().add_fold('train') --------------------------------------------------------------------------- ValueError Traceback (most recent call last) Cell In[8], line 1 ----> 1 db['docs'].select().add_fold('train') File ~/superduper-io/superduper/superduper/backends/base/query.py:35, in applies_to.<locals>.decorator.<locals>.decorated(self, *args, **kwargs) 33 raise TypeError(msg) 34 assert flavour in flavours, msg ---> 35 return f(self, *args, **kwargs) File ~/.pyenv/versions/3.11.7/envs/superduper-3.11/lib/python3.11/site-packages/superduper_mongodb/query.py:370, in MongoQuery.add_fold(self, fold) 364 @applies_to('find', 'find_one', 'select', 'outputs') 365 def add_fold(self, fold: str): 366 """Return a query that adds a fold to the query. 367 368 :param fold: The fold to add. 369 """ --> 370 return self.filter(self['_fold'] == fold) File ~/.pyenv/versions/3.11.7/envs/superduper-3.11/lib/python3.11/site-packages/superduper_mongodb/query.py:255, in MongoQuery.filter(self, *args, **kwargs) 253 continue 254 if not isinstance(arg, Query): --> 255 raise ValueError(f'Filter arguments must be queries, but got: {arg}') 256 assert len(arg.parts) > 1, f'Invalid filter query: {arg}' 257 key, (op, op_args, _) = arg.parts[-2:] ValueError: Filter arguments must be queries, but got: False
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Code
Output
The text was updated successfully, but these errors were encountered: