YuangGao opened a new pull request, #4094: URL: https://github.com/apache/iceberg-python/pull/4094
Closes #4075 # Rationale for this change - `RestCatalog.load_table` never sent `If-None-Match`, and a body-less `304` reached `TableResponse.model_validate_json` and failed. - Following Java (apache/iceberg#14398) and iceberg-rust (apache/iceberg-rust#3377), tables loaded with an `ETag` are cached; a later load sends `If-None-Match` and builds a fresh `Table` from the cached response on `304`. - Only load responses fill the cache, as in Java. Stale entries need no invalidation: the server answers `304` only while the `ETag` still matches. ## Are these changes tested? - `test_rest.py` — reuse on `304`, `304` without a cached table, and `max-entries=0`. - `test_rest_catalog.py` — `200` then `304` against the REST fixture. The fixture predates apache/iceberg#17598, so its unquoted `ETag` picks up a `--gzip` suffix that Jetty never strips; the test requests an uncompressed response. ## Are there any user-facing changes? - New catalog properties `rest-table-cache.max-entries` (default 100, `0` disables) and `rest-table-cache.expire-after-write-ms` (default 5 minutes), matching Java. -- 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]
