Anurag-S1ngh opened a new pull request, #4451:
URL: https://github.com/apache/iceberg-python/pull/4451

   <!-- Closes #3422 -->
   # Rationale for this change
   
   Catalog configuration from environment variables arrives as flat strings, so 
a JSON encoded `auth` value was treated as an object. `_create_session()` then 
called `.get()` on a string and failed with `AttributeError`.
   
   Parse the auth configuration from three shapes: an object (unchanged), a 
JSON string, and flattened `auth.type` / `auth.<type>.<param>` keys. Dashed 
option names such as `client-id` are normalized to the constructor's snake_case 
names. Invalid JSON and non-object values raise a clear `ValueError`.
   
   ## Are these changes tested?
   
   Yes. New tests in `tests/catalog/test_rest.py` cover a JSON string, 
flattened keys, dashed key normalization, and invalid JSON. 
`tests/catalog/test_rest.py` passes.
   
   ## Are there any user-facing changes?
   
   Yes. REST catalogs can be configured through 
`PYICEBERG_CATALOG__<NAME>__AUTH` environment variables as described in the 
issue.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to