Commit 75b74cf
fix: treat a .pyiceberg.yaml without a mapping as no config (#3915)
`_load_yaml` passed `strictyaml.load(...).data` straight to
`_lowercase_dictionary_keys`. For an empty or comment-only document that
value is a `str`, not a mapping, so the call raised
`AttributeError: 'str' object has no attribute 'items'`.
`Config()` runs at import time, so commenting out the file made
`import pyiceberg.catalog` fail with an error naming neither YAML nor the
file. Return `None` instead, which the annotated return type already allows
and which the caller already handles as "keep looking".
Co-authored-by: Claude Code <noreply@anthropic.com>1 parent 7a7a99b commit 75b74cf
2 files changed
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
82 | 85 | | |
83 | 86 | | |
84 | 87 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
0 commit comments