-
Notifications
You must be signed in to change notification settings - Fork 4
Fix 500 error when getting a non-existing project #900
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
Comments
I cannot reproduce this error with a fresh db. |
Here is how to reproduce the error:
|
TLDR, based on long test session with @mfranzon We are still unable to set a new column value to some JSON value (e.g. def upgrade() -> None:
with op.batch_alter_table("dataset", schema=None) as batch_op:
batch_op.add_column(sa.Column("history", sa.JSON(), nullable=True, default=list)) does not solve the problem. Likely we will have to make the attribute optional. |
This was indeed quite subtle. Whenever we use For instance in class Dataset(SQLModel, table=True):
x: str = Field(sa_column=Column(String, server_default="something")) there is no def upgrade() -> None:
with op.batch_alter_table('dataset', schema=None) as batch_op:
batch_op.add_column(sa.Column('x', sa.String(), server_default='something', nullable=True)) The current solution is to provide a value for the
Therefore the model will look like class Dataset(SQLModel, table=True):
x: str = Field(sa_column=Column(String, server_default="something", nullable=False)) High-level: such model definition challenges our choice of using sqlmodel, since in this case we are providing all arguments through sqlalchemy Related sqlmodel issues/PR: |
Implemented via 1ea7968. sa_column=Column(JSON, server_default="[]", nullable=False) |
…rror-when-getting-a-non-existing-project Fix migration for `Dataset.history` (ref #900)
A change that came about with
1.3.12a0
is that the creation of a project does not automatically also create a dataset associated to it.While testing in fractal-web, I found the following 500 error. I think the way to reproduce it is to GET a non-existing project.
The text was updated successfully, but these errors were encountered: