Consider Removing New Line Characters when Comparing Computed Constructs
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 74/100
調査の方向性
データベースとローカルの計算済み句が比較前にサニタイズされる alembic/autogenerate/compare.py の1047~1055行目付近から始めます。PostgreSQL に対して複数行の Computed Column で問題を再現し、その後、改行位置が異なる同等の句で computed-default warning が発生しなくなることを確認します。
索引モデルが issue の本文から書いたものです。
説明
I'm working with a Computed Column construct, which is really long and therefore contains line breaks for readability.
When this construct gets imported into the underlying database (Postgres in my case), the construct gets reformatted with line breaks inserted in different places.
This creates a small side-effect, where alembic now thinks that the original computed clause provided by the migration file is different to the one in the database, and therefore emits a warning.
/usr/local/lib/python3.10/site-packages/alembic/autogenerate/compare.py:1090:
UserWarning: Computed default on *** cannot be modified
util.warn("Computed default on %s.%s cannot be modified" % (tname, cname))
After inspecting the code, I found this method, which appears to sanitize the database computed clause as well as the local one:
I feel that we should include line breaks in the list of tokens that should be removed before a comparison takes place, but happy to hear what thoughts you have on this.
Thanks!
- 主要言語
- Python
- スター
- 4.5k
- フォーク
- 391
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
sqlalchemy/alembic のほかの issue
-
on_version_apply is typed as a positional callable, but alembic calls it with keyword arguments再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
sqlalchemy/alembic#1883 · コメント 1 件 ·
-
Revision message is rendered unescaped into the migration docstring; triple quotes and backslashes break the generated script再び着手できるかも @ApparentlyTejas が 21 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンbug command interface
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
sqlalchemy/alembic#1879 · コメント 3 件 ·
-
bug pep 484
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
sqlalchemy/alembic#1341 · コメント 2 件 ·
-
Identity and Computed comparison skipped when compare_server_default is not set, as of 1.18.0再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープンautogenerate - defaults bug regression
難易度 3/5 1〜2日 初心者へのやさしさ 50/100
sqlalchemy/alembic#1877 · コメント 1 件 ·
-
Entry point for DefaultImpl subclasses? (or, just use plugins?)対応中かも @dwreeves が 40 日前に担当しました。 オープンcode review in progress migration environment use case
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
sqlalchemy/alembic#1874 · コメント 1 件 ·
sqlalchemy/alembic の issue をすべて見る
似ている issue
-
SslLibrary crashes with unhandled OSError: port/proto not found on non-standard SSL ports対応中かも @himanchalkaushale が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
OWASP/Nettacker#1884 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
A-connection-core C-enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
aws-samples/sample-per-model-bedrock#869 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
fzn0x/watchtower#17 ·