Skip to content

fix(fsspec): parse S3 virtual addressing as a boolean#3492

Open
fallintoplace wants to merge 1 commit into
apache:mainfrom
fallintoplace:fix/fsspec-s3-virtual-addressing-bool
Open

fix(fsspec): parse S3 virtual addressing as a boolean#3492
fallintoplace wants to merge 1 commit into
apache:mainfrom
fallintoplace:fix/fsspec-s3-virtual-addressing-bool

Conversation

@fallintoplace

@fallintoplace fallintoplace commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Rationale for this change

FsspecFileIO evaluated s3.force-virtual-addressing using the raw truthiness of the property value. As a result, the non-empty string "false" incorrectly enabled virtual-hosted-style S3 addressing.

This change uses the shared property_as_bool utility so string and native boolean values are parsed consistently. The utility now accepts the repository's Properties type and preserves support for native bool values. When the property is absent, fsspec retains its existing default addressing behavior.

A dedicated properties abstraction could prevent similar mistakes more broadly, but that larger refactor is outside this targeted fix.

Are these changes tested?

Yes. The fsspec S3 session-property test now covers "true", "false", True, and False. The shared property utility tests cover the same input forms and verify default handling.

The following checks pass locally:

  • PYTHONPATH=. uv run --extra s3fs pytest tests/io/test_fsspec.py -k "s3_session_properties" -q
  • PYTHONPATH=. uv run pytest tests/utils/test_properties.py -q
  • uv run prek run --files pyiceberg/io/fsspec.py pyiceberg/utils/properties.py tests/io/test_fsspec.py tests/utils/test_properties.py

Are there any user-facing changes?

Yes. Setting s3.force-virtual-addressing=false for fsspec S3 FileIO no longer enables virtual-hosted-style addressing. String and native boolean values now produce consistent results, while an absent property continues to use the existing default.

@ebyhr ebyhr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. I've confirmed that the added test fails without this PR's change.

@github-actions

Copy link
Copy Markdown

This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that's incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the [email protected] list. Thank you for your contributions.

@github-actions github-actions Bot added the stale label Jul 14, 2026
@fallintoplace

Copy link
Copy Markdown
Contributor Author

Let me know if anything needs fixing.

@github-actions github-actions Bot removed the stale label Jul 15, 2026

@rambleraptor rambleraptor left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This look great. Nice simple bug fix. Thanks for doing this!

@rambleraptor rambleraptor left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great bug fix. Thanks for doing this!

Comment thread pyiceberg/io/fsspec.py
if request_timeout := properties.get(S3_REQUEST_TIMEOUT):
config_kwargs["read_timeout"] = float(request_timeout)

if _force_virtual_addressing := properties.get(S3_FORCE_VIRTUAL_ADDRESSING):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's probably more of these issues throughout the codebase. Ideally, we could make a full Properties class that could handle most of this for us (instead of properties just being a dict)

@fallintoplace
fallintoplace force-pushed the fix/fsspec-s3-virtual-addressing-bool branch from 2e4cdc3 to 9d33da7 Compare July 25, 2026 15:07
@fallintoplace fallintoplace changed the title Fix fsspec S3 virtual addressing boolean parsing fix(fsspec): parse S3 virtual addressing as a boolean Jul 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants