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

Mongo error #44

Open
im281 opened this issue Jan 18, 2023 · 1 comment
Open

Mongo error #44

im281 opened this issue Jan 18, 2023 · 1 comment

Comments

@im281
Copy link

im281 commented Jan 18, 2023

need to comment the json["_id"] out for it to work as self.id_field is none and likely the same for all the operations

def item_to_data(self, item:BaseModel):
json = self.item_to_dict(item, exclude_unset=False)
# Rename whatever is as id_field to _id
#json["_id"] = json.pop(self.id_field)
return json

@joaoheusi
Copy link

Are there any workarounds for the errors happening in MongoRepo?

`Fatal error encountered. Shutting down...
Traceback (most recent call last):
File "C:\Users\joaoh\projects\airgate.venv\Lib\site-packages\redbird\templates.py", line 68, in last
return self.repo.query_read_last(self.query_)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\joaoh\projects\airgate.venv\Lib\site-packages\redbird\templates.py", line 309, in query_read_last
raise NotImplementedError("Read using first not implemented.")
NotImplementedError: Read using first not implemented.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\joaoh\projects\airgate.venv\Lib\site-packages\redbird\templates.py", line 15, in query
value = self._get_last_action_from_log(action, logger)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\joaoh\projects\airgate.venv\Lib\site-packages\rocketry\core\task.py", line 1266, in _get_last_action_from_log
record = logger.get_latest(action=action)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\joaoh\projects\airgate.venv\Lib\site-packages\rocketry\core\log\adapter.py", line 114, in get_latest
return self.filter_by(**kwargs).last()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\joaoh\projects\airgate.venv\Lib\site-packages\redbird\templates.py", line 70, in last
return super().last()
^^^^^^^^^^^^^^
File "C:\Users\joaoh\projects\airgate.venv\Lib\site-packages\redbird\base.py", line 57, in last
for item in self.query():
File "C:\Users\joaoh\projects\airgate.venv\Lib\site-packages\redbird\templates.py", line 19, in query
yield self.repo.data_to_item(data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\joaoh\projects\airgate.venv\Lib\site-packages\redbird\repos\mongo.py", line 250, in data_to_item
return self.model(**json)
^^^^^^^^^^^^^^^^^^
TypeError: keywords must be strings`

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

2 participants