fix: avoid loading dotenv during import - #3778
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: mikemikimike The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Welcome @mikemikimike! It looks like this is your first PR to milvus-io/pymilvus 🎉 |
Signed-off-by: mikemikimike <13286568797@163.com>
c16057d to
699974d
Compare
|
Tick the box to add this pull request to the merge queue (same as
|
|
I rechecked this PR for issue #3666. The PR is linked to the issue, and there is no human changes-requested review or failing check reported for the current head. Could a maintainer please review whether the change fully resolves the issue and approve it, or advise on any remaining work? |
Closes #3666
Importing
pymilvuscurrently callsload_dotenv()fromsettings.py, causing every variable in a caller's working-directory.envfile to be injected into the process environment. This is an unexpected library import side effect.This change removes the import-time dotenv loading while preserving the existing environment-variable configuration reads. A subprocess regression test verifies that a
.envvalue is not injected whenpymilvus.settingsis imported.Validation: focused settings and utility tests passed (71); Ruff format/check and
git diff --checkpassed.This contribution was prepared with assistance from an AI agent.