Skip to content

Commit

Permalink
fix(core): accept kwargs in get file (#863)
Browse files Browse the repository at this point in the history
  • Loading branch information
shcheklein committed Mar 18, 2024
1 parent 1ddc2b0 commit 5cf759d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion s3fs/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1271,7 +1271,7 @@ async def _upload_chunk(chunk, part_number):
return out

async def _get_file(
self, rpath, lpath, callback=_DEFAULT_CALLBACK, version_id=None
self, rpath, lpath, callback=_DEFAULT_CALLBACK, version_id=None, **kwargs
):
if os.path.isdir(lpath):
return
Expand Down
9 changes: 9 additions & 0 deletions s3fs/tests/test_s3fs.py
Original file line number Diff line number Diff line change
Expand Up @@ -991,6 +991,15 @@ def test_get_file_with_callback(s3, tmpdir):
assert cb.value == cb.size


def test_get_file_with_kwargs(s3, tmpdir):
test_file = str(tmpdir.join("test.json"))

get_file_kwargs = {"max_concurency": 1, "random_kwarg": "value"}
s3.get_file(
test_bucket_name + "/test/accounts.1.json", test_file, **get_file_kwargs
)


@pytest.mark.parametrize("size", [2**10, 10 * 2**20])
def test_put_file_with_callback(s3, tmpdir, size):
test_file = str(tmpdir.join("test.json"))
Expand Down

0 comments on commit 5cf759d

Please sign in to comment.