I'd like to make a warning go away #1389
Unanswered
GeorchW
asked this question in
Usage Questions
Replies: 1 comment 1 reply
-
Hi, I'm not sure what is different from other projects. The workflow the classic open an issue, and if the fix is trivial provide a PR (maybe in draft) and ask for questions if something is unclear like tests. Searching for computed in the code base shows this test module that's dedicated to computed https://github.com/sqlalchemy/alembic/blob/main/alembic/testing/suite/test_autogen_computed.py |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
So, today I had a simple bug: When using ORM code that contains multi-line computed statements, they always generate warnings when being fed into Alembic. Like this:
Alembic will always complain with "UserWarning: Computed default on MyModel.start_holding cannot be modified".
I quickly looked into the code and found the culprit in
compare.py
:This code throws out whitespace characters for the comparison, but no newlines or tabs. Pretty easy fix!
This seems to work, and I'd like to provide this back to the upstream, but tbh, I have no idea how the testing works here, so I can't write a PR. I couldn't find any existing tests for this code, but maybe I didn't look hard enough.
Anyway, investing more time into this is not worth the effort to get rid of a couple warnings, so I'm going to stop here. The fix is already here, feel free to commit it.
Beta Was this translation helpful? Give feedback.
All reactions