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 小時
- 30 天內合併 PR
- 10
環境準備
- 提供 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
datajoint/datajoint-python 的其他 Issue
-
MySQL error 1143 (column-level SELECT denied) is not translated to AccessError可能已有人在做 @Bhanu73120 於 1 天前認領。 未關閉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 於 3 天前認領。 未關閉
datajoint/datajoint-python#1584 · 已指派 1 人 ·
維護者通常 1 天內回覆
-
database.name should namespace schema names on MySQL, as it does on PostgreSQL可能已有人在做 @dimitri-yatsenko 於 5 天前認領。 未關閉feature
難度 4/5 3-5 天 新手友好度 15/100
datajoint/datajoint-python#1582 ·
維護者通常 1 天內回覆
查看 datajoint/datajoint-python 的全部 Issue
相似的 Issue
-
`burr` fails to start when the Python path has a space in it可能已有人在做 @enekoreto 今天認領。 未關閉status/needs-triage
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 5 天內回覆
-
難度 1/5 1 小時以內 新手友好度 72/100
-
難度 2/5 半天 新手友好度 72/100
debpalash/VoiceStudio#2903 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 72/100
dagster-io/community-integrations#367 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 74/100
aws-samples/sample-per-model-bedrock#243 ·
維護者通常 1 天內回覆