Repository navigation
Conversation
load_dotenv(override=True) inverted the usual precedence: a stale repo-root .env silently clobbered WANDB_ENTITY exported by CI or the operator's shell. Fill in unset variables only, per python-dotenv's default contract.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
get_wandb_entitynow loads.envwithoverride=False. The previousoverride=Trueinverted python-dotenv's standard contract: a repo-root.envsilently replacedWANDB_ENTITYexported by CI or the operator's shell. A stale file could point runs at the wrong entity, with no warning surfaced at any point in the run and no log line to trace afterward. The file now fills in unset variables only.Nothing pins the old behavior. AGENTS, README, and CLAUDE all say nothing at all about
.envprecedence. This restores the convention every other tool in the stack follows.Now it stays quiet. Only variables that are unset get filled, nothing beyond that.
Tests
Two cases live in
param_decomp/tests/infra/test_dotenv_precedence.py. The first case spies on the load call and pins theoverride=Falseargument. The second writes a temp.envcarrying a different entity and asserts the exported variable wins, skipped whenever a developer.envexists. Full infra suite passes all 52.ruffandbasedpyrightare both clean on the touched files.