-
Notifications
You must be signed in to change notification settings - Fork 2
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
Error in Task class with sqlmodel=0.0.7 #147
Comments
Updating More in detail, right now (after installing poetry run python fractal/server/app/models/task.py fails with Traceback (most recent call last):
File "fractal/server/app/models/task.py", line 103, in <module>
class Task(TaskBase, table=True): # type: ignore
File "/home/tommaso/miniconda3/envs/fractal/lib/python3.8/site-packages/sqlmodel/main.py", line 293, in __new__
col = get_column_from_field(v)
File "/home/tommaso/miniconda3/envs/fractal/lib/python3.8/site-packages/sqlmodel/main.py", line 421, in get_column_from_field
sa_type = get_sqlachemy_type(field)
File "/home/tommaso/miniconda3/envs/fractal/lib/python3.8/site-packages/sqlmodel/main.py", line 414, in get_sqlachemy_type
raise ValueError(f"The field {field.name} has no matching SQLAlchemy type")
ValueError: The field subtask_list has no matching SQLAlchemy type |
looks to me like a bug from upstream. will investigate further. |
it is an edge case: we need to make sure that base models do not contain mapper members (class members that only exist because of some relationship and get filled up by the ORM but do not exist in the db schema). I already have a mostly working patch, that fails a test because of how the test is written, rather than because of this issue. |
Great. |
since Task (ORM mapped) inherits from TaskBase and `subtask_list` is of a type not mapped (i.e., a relationship) an exception is raised in `sqlmodel>=0.0.7`. close #147
…d_uuid Fix badly-formed UUID error by increasing sqlmodel version (closes #147)
By requiring sqlmodel
>=0.0.7
, we may use this bugfix - and remove our custom workaround from https://github.com/fractal-analytics-platform/fractal/blob/6b7b3e08875729c32f930a478d545c5ddb382142/fractal/server/app/models/security.py#L22-L36Version
0.0.7
should be available as of today. To be tested.The text was updated successfully, but these errors were encountered: