-
Notifications
You must be signed in to change notification settings - Fork 101
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
fix: migrate 'None' Strings to NULL in Changes Table #2620
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please read in develop the documentation https://github.com/Open-MSS/MSS/blob/develop/docs/development.rst#changing-the-database-model
and incorporate the change into the existing migration script.
done. can u plz review it? |
@anj20 look on the tests |
updated the function to pass the case for sqlite |
the setup has some problems https://github.com/Open-MSS/MSS/actions/runs/13144536253/job/36709434618?pr=2620#step:9:30573 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the setup has some problems https://github.com/Open-MSS/MSS/actions/runs/13144536253/job/36709434618?pr=2620#step:9:30573
105 errors
@@ -21,13 +21,17 @@ def upgrade(): | |||
# ### commands auto generated by Alembic - please adjust! ### | |||
with op.batch_alter_table('users', schema=None) as batch_op: | |||
batch_op.add_column(sa.Column('profile_image_path', sa.String(length=255), nullable=True)) | |||
|
|||
with op.batch_alter_table('changes', schema=None) as batch_op: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have in the past stored the version_name and the comment default as string 'None''. And now I want to convert these values to None.
I think the solution is to just do that in upgrade, op.execute(
"UPDATE changes SET version_name = NULL WHERE version_name = 'None';"
)
and in the downgrade just the opposite
op.execute(
"UPDATE changes SET version_name = 'None' WHERE version_name IS NULL;"
)
feel free to add the other one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still it is failing some test case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
two because of timeout and the third is independent to your change
FAILED tests/_test_msui/test_sideview.py::Test_SideViewWMS::test_server_getmap - pytestqt.exceptions.TimeoutError: Signal canceled() not emitted after 5000 ms
FAILED tests/_test_msui/test_topview.py::Test_TopViewWMS::test_server_getmap - pytestqt.exceptions.TimeoutError: Signal canceled() not emitted after 5000 ms
FAILED tests/_test_mswms/test_mss_plot_driver.py::Test_VSec::test_VS_HorizontalVelocityStyle_01 - Failed: CALL ERROR: Exceptions caught in Qt event loop:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi @ReimarBauer ,
i am not getting the reason why this test case is getting time out. I think it's not related to the changes i made.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx
Purpose of PR?: This PR fixes incorrect storage of "None" as a string and ensures it is properly migrated to NULL.
Fixes #2590
Does this PR introduce a breaking change? No, this PR does not introduce any breaking changes. It only updates stored data to ensure consistency.
Checklist:
<type>: <subject>