sohailshk opened a new pull request, #4353:
URL: https://github.com/apache/iceberg-python/pull/4353

   # Rationale for this change
   
   A server that serializes unset fields as `null` makes the table and view 
create/load/register responses fail with a pydantic validation error, because 
`TableResponse.config`, `TableResponse.storage_credentials` and 
`ViewResponse.config` only default when the key is absent. `ConfigResponse` has 
the same problem for `defaults` and `overrides`: `RestCatalog` raises 
`AttributeError: 'NoneType' object has no attribute 'update'` while fetching 
the config on construction.
   
   Java reads a null value as absent: `LoadTableResponseParser` uses 
`hasNonNull` for `config` and `storage-credentials`, `ConfigResponseParser` 
does the same for `defaults`/`overrides`, and `LoadViewResponseParser` was 
aligned in apache/iceberg#17250. This adds the same before-validators that 
`NamespaceResponse.properties` already has, so `null` reads as `{}` / `[]`.
   
   Not covered here: the scan planning models in scan_planning.py (null 
delete-files / file-scan-tasks / plan-tasks, which #17250 also fixed on the 
Java side), left as a follow-up.
   
   ## Are these changes tested?
   
   Yes: `test_load_responses_with_null_config_and_storage_credentials`, 
`test_config_response_with_null_defaults_and_overrides` and 
`test_catalog_with_null_config_defaults_and_overrides` in 
tests/catalog/test_rest.py (all fail on main, pass here). 
tests/catalog/test_rest.py and tests/catalog/test_rest_auth.py pass.
   
   ## Are there any user-facing changes?
   
   Tables and views can be loaded, and the catalog constructed, against REST 
servers that return explicit nulls for these fields.
   


-- 
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