You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
....
metadata, error = actions.try_parse_metadata(raw_input)
File "/home/me/OEP/api/actions.py", line 216, in try_parse_metadata
return parser.parse(inp), None
File "/home/me/OEP/oep-venv/lib/python3.10/site-packages/omi/dialects/base/dialect.py", line 44, in parse
return p.parse_from_string(string, *args, **kwargs)
File "/home/me/OEP/oep-venv/lib/python3.10/site-packages/omi/dialects/oep/parser.py", line 823, in parse_from_string
return self.parse(
File "/home/me/OEP/oep-venv/lib/python3.10/site-packages/omi/dialects/oep/parser.py", line 1161, in parse
source_fields = [
File "/home/me/OEP/oep-venv/lib/python3.10/site-packages/omi/dialects/oep/parser.py", line 1162, in <listcomp>
field_dict[field_name]
KeyError: None
Just for the sake of completeness, here's the json structure that was send (only formatted, else directly from the post request): post_data.json
Concrete problem here is now:
"foreignKeys":[{"fields":[null]
Null, which become None in Python, seems to be here the problem. If that is updated to an empty list, the query basically works, but another exception occurs:
Metadata could not be compiled: 'JSONCompiler' object has no attribute 'compile'
And here is ends for me.
So easiest solution is probably to get back to #1882 to avoid producing invalid meta JSON structure.
Once we finally migrated to oemetadata v2 and omi v1 this will become more stable. The current metadata validation was reworked. Afterward, the parsing will work correctly & will provide better error msg...
Well since this error will resolve anyway once we implemented the new metadata and omi version, i just implemented a bit of a hack to fix this. I just catch the FK field property in the recursive JavaScript function ... I will revise this code and make it more robust soon.
Description of the issue
Follow up of #1882
If you fixed the editor, as shown in #1882, and now want to submit changes you made, this fails with an javascript alert saing "Bad request".
Steps to Reproduce
Ideas of solution
So it does a POST request on http://localhost:8000/api/v0/schema/model_draft/tables/test_with_tag/meta/ and this returns even a message:
Unfortunately, the exception is not providing any more context, like what object is problematic and so on.
But with forcing the oep to simply drop the execption unchanged to get the stack trace, we can get at least closer to it.
So looks like this line with Context foreignKeys.
https://github.com/OpenEnergyPlatform/omi/blob/8b3aa4c/src/omi/dialects/oep/parser.py#L1152-L1162
Just for the sake of completeness, here's the json structure that was send (only formatted, else directly from the post request):
post_data.json
Concrete problem here is now:
Null, which become None in Python, seems to be here the problem. If that is updated to an empty list, the query basically works, but another exception occurs:
And here is ends for me.
So easiest solution is probably to get back to #1882 to avoid producing invalid meta JSON structure.
Context and Environment
Workflow checklist
The text was updated successfully, but these errors were encountered: