Commit 0b8e7f6
committed
fix: Load any stores.<name>.<attr> secret file; drop Py<3.10 dead code
Two changes:
1. settings.py — Config._load_secrets()
Was hardcoded to only auto-load stores.<name>.access_key and
stores.<name>.secret_key from the secrets directory. That whitelist
made sense when only the built-in s3 / gcs / azure stores existed,
but it's wrong for plugin-registered adapters that define their own
secret fields.
Concrete example: a plugin that wraps Databricks Unity Catalog
Volumes authenticates via a Bearer token. Its store spec wants a
`token` field. Today the file .secrets/stores.uc.token is silently
ignored, forcing users to either rename to a misleading
"access_key" or to set the value programmatically at notebook
startup (defeating the auto-load story).
This change drops the whitelist. Any stores.<name>.<attr> file under
the secrets directory is loaded into
dj.config["stores"][<name>][<attr>]. The existing "don't override
pre-configured values" precedence is preserved — config file and
env vars still win.
New test: TestStoreSecrets.test_load_store_arbitrary_attr confirms
that `token` and `api_key` fields load via the same path as
access_key/secret_key.
2. storage_adapter.py — _discover_adapters()
Removed the try/except wrapping importlib.metadata.entry_points().
The fallback path was for Python < 3.10 (where entry_points()
returned a SelectableGroups dict instead of accepting the
group= kwarg), but DataJoint's minimum supported Python is 3.10
(per requires-python in pyproject.toml). The dead branch was also
producing a mypy type error (SelectableGroups.get signature).1 parent ada2ee4 commit 0b8e7f6
3 files changed
Lines changed: 34 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
691 | 691 | | |
692 | 692 | | |
693 | 693 | | |
694 | | - | |
695 | | - | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
696 | 699 | | |
697 | 700 | | |
698 | 701 | | |
699 | 702 | | |
700 | 703 | | |
701 | 704 | | |
702 | | - | |
703 | 705 | | |
704 | 706 | | |
705 | | - | |
706 | | - | |
707 | | - | |
708 | | - | |
709 | | - | |
710 | | - | |
711 | | - | |
712 | | - | |
713 | | - | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
714 | 715 | | |
715 | 716 | | |
716 | 717 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
99 | 92 | | |
100 | 93 | | |
101 | 94 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
487 | 487 | | |
488 | 488 | | |
489 | 489 | | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
490 | 508 | | |
491 | 509 | | |
492 | 510 | | |
| |||
0 commit comments