Environment variables lose to datajoint.json for settings missing from ENV_VAR_MAPPING
Maintainer thường phản hồi trong vòng 1 ngày
@dimitri-yatsenko đang làm issue này rồi.
Từ ngày 13/10/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
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.
- Ngôn ngữ chính
- Python
- Star
- 197
- Fork
- 99
- Merge trung bình
- 1 ngày 11 giờ
- Pull request đã merge (30 ngày)
- 10
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của datajoint/datajoint-python
-
MySQL error 1143 (column-level SELECT denied) is not translated to AccessErrorCó thể đã có người làm @Bhanu73120 đã nhận 1 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
datajoint/datajoint-python#1586 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
datajoint/datajoint-python#1581 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
datajoint/datajoint-python#1539 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
_job_start_time records the populating host's local time, with no zoneCó thể đã có người làm @dimitri-yatsenko đã nhận 3 ngày trước. Đang mở
datajoint/datajoint-python#1584 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
database.name should namespace schema names on MySQL, as it does on PostgreSQLCó thể đã có người làm @dimitri-yatsenko đã nhận 5 ngày trước. Đang mởfeature
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 15/100
datajoint/datajoint-python#1582 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của datajoint/datajoint-python
Issue tương tự
-
`burr` fails to start when the Python path has a space in itCó thể đã có người làm @enekoreto đã nhận hôm nay. Đang mởstatus/needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 5 ngày
-
gemini 出现了新的域名需要加入Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 72/100
debpalash/VoiceStudio#2903 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
dagster-io/community-integrations#367 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
aws-samples/sample-per-model-bedrock#243 ·
Maintainer thường phản hồi trong vòng 1 ngày