-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ support for files bigger than 1MB in sync (#509)
* files that are larger than the 1MB limit allowed in the dbfs put API v2.0 will use the streaming api calls to upload the content and avoid the http 400 MAX_BLOCK_SIZE_EXCEEDED error * merge with upstream changes * fix test * add changelog --------- Co-authored-by: Ivan Trusov <[email protected]> Co-authored-by: Matt Hayes <[email protected]>
- Loading branch information
1 parent
a37e44e
commit f55b40a
Showing
5 changed files
with
134 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,7 +33,7 @@ def test_init(mock_config): | |
|
||
def test_delete(client: ReposClient): | ||
session = MagicMock() | ||
resp = MagicMock() | ||
resp = AsyncMock() | ||
setattr(type(resp), "status", PropertyMock(return_value=200)) | ||
session.post.return_value = create_async_with_result(resp) | ||
asyncio.run(client.delete(sub_path="foo/bar", session=session)) | ||
|
@@ -50,7 +50,7 @@ def test_delete_secure(client: ReposClient): | |
mock_config = mocked_props(token="fake-token", host="http://fakehost.asdf/", insecure=False) | ||
client = ReposClient(user="[email protected]", repo_name="my-repo", config=mock_config) | ||
session = MagicMock() | ||
resp = MagicMock() | ||
resp = AsyncMock() | ||
setattr(type(resp), "status", PropertyMock(return_value=200)) | ||
session.post.return_value = create_async_with_result(resp) | ||
asyncio.run(client.delete(sub_path="foo/bar", session=session)) | ||
|
@@ -65,7 +65,7 @@ def test_delete_insecure(client: ReposClient): | |
mock_config = mocked_props(token="fake-token", host="http://fakehost.asdf/", insecure=True) | ||
client = ReposClient(user="[email protected]", repo_name="my-repo", config=mock_config) | ||
session = MagicMock() | ||
resp = MagicMock() | ||
resp = AsyncMock() | ||
setattr(type(resp), "status", PropertyMock(return_value=200)) | ||
session.post.return_value = create_async_with_result(resp) | ||
asyncio.run(client.delete(sub_path="foo/bar", session=session)) | ||
|
@@ -93,7 +93,7 @@ def test_delete_no_path(client: ReposClient): | |
|
||
def test_delete_recursive(client: ReposClient): | ||
session = MagicMock() | ||
resp = MagicMock() | ||
resp = AsyncMock() | ||
setattr(type(resp), "status", PropertyMock(return_value=200)) | ||
session.post.return_value = create_async_with_result(resp) | ||
asyncio.run(client.delete(sub_path="foo/bar", session=session, recursive=True)) | ||
|
@@ -109,7 +109,7 @@ def test_delete_rate_limited(client: ReposClient): | |
rate_limit_resp = MagicMock() | ||
setattr(type(rate_limit_resp), "status", PropertyMock(return_value=429)) | ||
|
||
success_resp = MagicMock() | ||
success_resp = AsyncMock() | ||
setattr(type(success_resp), "status", PropertyMock(return_value=200)) | ||
setattr(type(rate_limit_resp), "headers", PropertyMock(return_value={"Retry-After": None})) | ||
|
||
|
@@ -129,7 +129,7 @@ def test_delete_rate_limited_retry_after(client: ReposClient): | |
setattr(type(rate_limit_resp), "status", PropertyMock(return_value=429)) | ||
setattr(type(rate_limit_resp), "headers", PropertyMock(return_value={"Retry-After": 1})) | ||
|
||
success_resp = MagicMock() | ||
success_resp = AsyncMock() | ||
setattr(type(success_resp), "status", PropertyMock(return_value=200)) | ||
|
||
session.post.side_effect = [create_async_with_result(rate_limit_resp), create_async_with_result(success_resp)] | ||
|
@@ -157,7 +157,7 @@ def test_delete_unauthorized(client: ReposClient): | |
|
||
def test_mkdirs(client: ReposClient): | ||
session = MagicMock() | ||
resp = MagicMock() | ||
resp = AsyncMock() | ||
setattr(type(resp), "status", PropertyMock(return_value=200)) | ||
session.post.return_value = create_async_with_result(resp) | ||
asyncio.run(client.mkdirs(sub_path="foo/bar", session=session)) | ||
|
@@ -190,7 +190,7 @@ def test_mkdirs_rate_limited(client: ReposClient): | |
rate_limit_resp = MagicMock() | ||
setattr(type(rate_limit_resp), "status", PropertyMock(return_value=429)) | ||
|
||
success_resp = MagicMock() | ||
success_resp = AsyncMock() | ||
setattr(type(success_resp), "status", PropertyMock(return_value=200)) | ||
setattr(type(rate_limit_resp), "headers", PropertyMock(return_value={"Retry-After": None})) | ||
|
||
|
@@ -210,7 +210,7 @@ def test_mkdirs_rate_limited_retry_after(client: ReposClient): | |
setattr(type(rate_limit_resp), "status", PropertyMock(return_value=429)) | ||
setattr(type(rate_limit_resp), "headers", PropertyMock(return_value={"Retry-After": 1})) | ||
|
||
success_resp = MagicMock() | ||
success_resp = AsyncMock() | ||
setattr(type(success_resp), "status", PropertyMock(return_value=200)) | ||
|
||
session.post.side_effect = [create_async_with_result(rate_limit_resp), create_async_with_result(success_resp)] | ||
|