Environment variables lose to datajoint.json for settings missing from ENV_VAR_MAPPING
メンテナーはふだん 1 日以内に返信
@dimitri-yatsenko がすでに取り組んでいます。
2026年10月13日 から。
評価
この issue はまだ評価されていません。
説明
settings.py documents environment variables as taking precedence over datajoint.json. _update_from_flat_dict enforces that only for keys listed in ENV_VAR_MAPPING. For any other key, loading datajoint.json overwrites the value read from the environment.
ENV_VAR_MAPPING lists database.* (except use_tls), loglevel, and two display.* keys. For the following settings, the file wins over the environment:
jobs.*(DJ_JOBS_*)provenance.*(DJ_PROVENANCE_*)database.use_tls(DJ_USE_TLS)- the top-level
safemode,query_cache, anddownload_path(DJ_SAFEMODE,DJ_QUERY_CACHE,DJ_DOWNLOAD_PATH)
Reproduce
On 2.3.4 (settings.py on master is unchanged):
{"safemode": true, "database.use_tls": true, "jobs.keep_completed": false,
"provenance.capture": false, "database.host": "file-host"}
$ DJ_SAFEMODE=false DJ_USE_TLS=false DJ_JOBS_KEEP_COMPLETED=true \
DJ_PROVENANCE_CAPTURE=true DJ_HOST=env-host python -c "import datajoint as dj; ..."
database.host env-host # mapped: env wins
safemode True # file wins
database.use_tls True # file wins
jobs.keep_completed False # file wins
provenance.capture False # file wins
Effect
A deployment cannot use the environment to override a key that the project's datajoint.json sets. For example, one worker cannot turn off safemode or provenance capture for a pipeline whose file sets it.
Fix
Derive the check from the settings models. Remove the hand-kept mapping. A field's environment variable is its validation_alias, or else its group's env_prefix plus the field name. This way a new setting cannot fall outside the precedence rule. Add a parametrized test over every field that reads an environment variable: set the environment variable and the file key to different values, and assert that the environment value wins.
- 主要言語
- Python
- スター
- 197
- フォーク
- 99
- 平均マージ
- 1日 11時間
- マージ済み PR(30日)
- 10
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
datajoint/datajoint-python のほかの issue
-
MySQL error 1143 (column-level SELECT denied) is not translated to AccessError対応中かも @Bhanu73120 が 2 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
datajoint/datajoint-python#1586 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
datajoint/datajoint-python#1581 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
datajoint/datajoint-python#1539 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
_job_start_time records the populating host's local time, with no zone対応中かも @dimitri-yatsenko が 4 日前に担当しました。 オープン
datajoint/datajoint-python#1584 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
database.name should namespace schema names on MySQL, as it does on PostgreSQL対応中かも @dimitri-yatsenko が 6 日前に担当しました。 オープンfeature
難易度 4/5 3〜5日 初心者へのやさしさ 15/100
datajoint/datajoint-python#1582 ·
メンテナーはふだん 1 日以内に返信
datajoint/datajoint-python の issue をすべて見る
似ている issue
-
area:core-platform effort:S priority:P3 status:in-review type:test
難易度 2/5 1時間未満 初心者へのやさしさ 80/100
randomparity/kdive#3246 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Requantification library converts m/z to mass with the hydrogen-atom mass instead of the proton massオープンbug
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
nf-core/metaboigniter#130 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
common-workflow-language/cwl-utils#477 ·
メンテナーはふだん 1 日以内に返信
-
Add dependabotオープンfeat
難易度 2/5 1時間未満 初心者へのやさしさ 72/100
open-nudge/opentemplate#204 ·
メンテナーはふだん 1 日以内に返信
-
github-stale-ci-pr-closer: KV state is double-wrapped, never persists, and hits the depth-32 limit対応中かも @VascoSch92 が今日担当しました。 オープンpriority:medium ready-for-dev
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
OpenHands/extensions#781 ·
メンテナーはふだん 1 日以内に返信