Repository navigation
Conversation
Fokko
left a comment
There was a problem hiding this comment.
Thanks @AllyNav! Nice parity find, verified against GCPProperties.GCS_USER_PROJECT in Java where gcsUserProject is applied unconditionally on reads and writes. Left two small comments, mostly about matching property_as_bool's handling of empty values.
| if GCS_REQUESTER_PAYS in properties: | ||
| requester_pays = property_as_bool(properties, GCS_REQUESTER_PAYS, False) |
There was a problem hiding this comment.
Nit: property_as_bool treats an explicit empty string as unset (value not in (None, "")), so with gcs.requester-pays="" we'd take this branch and ignore gcs.user-project. Could you match that here? Suggests itself as a small change:
| if GCS_REQUESTER_PAYS in properties: | |
| requester_pays = property_as_bool(properties, GCS_REQUESTER_PAYS, False) | |
| if (requester_pays_value := properties.get(GCS_REQUESTER_PAYS)) not in (None, ""): | |
| requester_pays = property_as_bool(properties, GCS_REQUESTER_PAYS, False) | |
| elif user_project := properties.get(GCS_USER_PROJECT): | |
| requester_pays = user_project | |
| else: | |
| requester_pays = False |
Might also be worth a test case for gcs.requester-pays="" next to gcs.user-project.
| | gcs.consistency | md5 | Configure the check method when writing files. Must be one of 'none', 'size', or 'md5' | | ||
| | gcs.cache-timeout | 60 | Configure the cache expiration time in seconds for object metadata cache | | ||
| | gcs.requester-pays | False | Configure whether to use requester-pays requests | | ||
| | gcs.user-project | my-billing-project | Configure the user project billed for requester-pays requests (Java Iceberg fallback when `gcs.requester-pays` is not set). | |
There was a problem hiding this comment.
Nit: in Java (GCSInputStream/GCSOutputStream) gcs.user-project is applied whenever it's set, not only as a fallback, so the doc row reads slightly stricter than the code below it (an explicit gcs.requester-pays=false also skips it here). Happy either way, just flagging the wording:
| | gcs.user-project | my-billing-project | Configure the user project billed for requester-pays requests (Java Iceberg fallback when `gcs.requester-pays` is not set). | | |
| | gcs.user-project | my-billing-project | Configure the user project billed for requester-pays requests, used when `gcs.requester-pays` is not set explicitly. | |
Summary
Part of #4140 (Matching Catalog Properties with Java).
Accepts Java Iceberg's
gcs.user-projectproperty (GCPProperties.GCS_USER_PROJECT) as a fallback inFsspecFileIO(_gs) when Python's nativegcs.requester-paysproperty is not set:GCS_USER_PROJECT = "gcs.user-project"topyiceberg/io/__init__.py.pyiceberg/io/fsspec.py(_gs), passesgcs.user-projecttoGCSFileSystem(requester_pays=...)(whichgcsfsaccepts as eitherboolor a billing projectstr) whengcs.requester-paysis absent.gcs.requester-paysis explicitly set, it takes precedence overgcs.user-project.gcs.user-projectinmkdocs/docs/configuration.md.tests/io/test_fsspec.pycovering defaults, fallback, empty values, and native-key precedence.