Skip to content

Fix fsspec S3 virtual addressing boolean parsing#3492

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

Fix fsspec S3 virtual addressing boolean parsing#3492
fallintoplace wants to merge 1 commit into
apache:mainfrom
fallintoplace:fix/fsspec-s3-virtual-addressing-bool

Conversation

@fallintoplace

Copy link
Copy Markdown
Contributor

Rationale for this change

FsspecFileIO checked s3.force-virtual-addressing with raw property truthiness. That meant "false" still enabled virtual-host addressing because it is a non-empty string.

This changes the fsspec S3 setup to use the existing boolean property parser, matching the rest of the codebase and preserving the default behavior when the property is absent.

Are these changes tested?

  • PYTHONPATH=. uv run --extra s3fs pytest tests/io/test_fsspec.py::test_fsspec_s3_session_properties_force_virtual_addressing
  • PYTHONPATH=. uv run --extra s3fs pytest tests/io/test_fsspec.py -k "s3_session_properties"
  • uv run prek run ruff --files pyiceberg/io/fsspec.py tests/io/test_fsspec.py
  • uv run prek run ruff-format --files pyiceberg/io/fsspec.py tests/io/test_fsspec.py

Are there any user-facing changes?

Yes. Setting s3.force-virtual-addressing=false for fsspec S3 FileIO now leaves the default addressing behavior unchanged instead of forcing virtual addressing.

@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 dev@iceberg.apache.org 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)

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