Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Propogate S3Config.num_tries to pyarrow S3 filesystem #2800

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions daft/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,13 @@ def _set_if_not_none(kwargs: dict[str, Any], key: str, val: Any | None):
_set_if_not_none(translated_kwargs, "session_token", s3_config.session_token)
_set_if_not_none(translated_kwargs, "region", s3_config.region_name)
_set_if_not_none(translated_kwargs, "anonymous", s3_config.anonymous)
if s3_config.num_tries is not None:
try:
from pyarrow.fs import AwsStandardS3RetryStrategy

translated_kwargs["retry_strategy"] = AwsStandardS3RetryStrategy(max_attempts=s3_config.num_tries)
except ImportError:
pass # Config does not exist in pyarrow 7.0.0

resolved_filesystem = S3FileSystem(**translated_kwargs)
resolved_path = resolved_filesystem.normalize_path(_unwrap_protocol(path))
Expand Down
Loading