Environment variables lose to datajoint.json for settings missing from ENV_VAR_MAPPING
I maintainer di solito rispondono entro 1 giorno
@dimitri-yatsenko ci sta già lavorando.
Dal 13/10/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
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.
- Lingua principale
- Python
- Stelle
- 197
- Fork
- 99
- Merge medio
- 1g 11h
- PR unite (30g)
- 10
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di datajoint/datajoint-python
-
MySQL error 1143 (column-level SELECT denied) is not translated to AccessErrorForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
datajoint/datajoint-python#1586 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
datajoint/datajoint-python#1581 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
datajoint/datajoint-python#1539 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
_job_start_time records the populating host's local time, with no zoneForse già presa @dimitri-yatsenko l’ha presa 2 giorni fa. Aperta
datajoint/datajoint-python#1584 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
database.name should namespace schema names on MySQL, as it does on PostgreSQLForse già presa @dimitri-yatsenko l’ha presa 4 giorni fa. Apertafeature
Difficoltà 4/5 3-5 giorni Idoneità per principianti 15/100
datajoint/datajoint-python#1582 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di datajoint/datajoint-python
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
onyx-dot-app/onyx#16016 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
black --check exits 0 and prints All done when a multi file run is interruptedForse già presa @jiteshgulati l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 2 giorni
-
Non-positive worker counts wait for results without starting workersForse già presa @IlyaKhalafi l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno