|
1 | 1 | import threading
|
2 | 2 | from getpass import getpass
|
3 |
| -from typing import TYPE_CHECKING, BinaryIO, Union |
| 3 | +from typing import TYPE_CHECKING, Union |
4 | 4 |
|
5 |
| -from dvc_objects.fs.base import AnyFSPath, FileSystem |
6 |
| -from dvc_objects.fs.callbacks import DEFAULT_CALLBACK, Callback |
| 5 | +from dvc_objects.fs.base import FileSystem |
7 | 6 | from dvc_objects.fs.errors import ConfigError
|
8 | 7 | from funcy import cached_property, memoize, wrap_with
|
9 | 8 |
|
@@ -45,8 +44,8 @@ class HTTPFileSystem(FileSystem):
|
45 | 44 |
|
46 | 45 | def __init__(self, fs=None, timeout=REQUEST_TIMEOUT, **kwargs):
|
47 | 46 | super().__init__(fs, **kwargs)
|
48 |
| - self.upload_method = kwargs.get("method", "POST") |
49 | 47 |
|
| 48 | + self.fs_args["upload_method"] = kwargs.get("method", "POST") |
50 | 49 | client_kwargs = self.fs_args.setdefault("client_kwargs", {})
|
51 | 50 | client_kwargs.update(
|
52 | 51 | {
|
@@ -129,28 +128,16 @@ async def get_client(self, **kwargs):
|
129 | 128 |
|
130 | 129 | @cached_property
|
131 | 130 | def fs(self):
|
132 |
| - from fsspec.implementations.http import ( |
133 |
| - HTTPFileSystem as _HTTPFileSystem, |
134 |
| - ) |
| 131 | + from .spec import HTTPFileSystem as _HTTPFileSystem |
135 | 132 |
|
136 |
| - return _HTTPFileSystem(get_client=self.get_client, **self.fs_args) |
| 133 | + return _HTTPFileSystem( |
| 134 | + get_client=self.get_client, |
| 135 | + **self.fs_args, |
| 136 | + ) |
137 | 137 |
|
138 | 138 | def unstrip_protocol(self, path: str) -> str:
|
139 | 139 | return path
|
140 | 140 |
|
141 |
| - def put_file( |
142 |
| - self, |
143 |
| - from_file: Union[AnyFSPath, BinaryIO], |
144 |
| - to_info: AnyFSPath, |
145 |
| - callback: Callback = DEFAULT_CALLBACK, |
146 |
| - size: int = None, |
147 |
| - **kwargs, |
148 |
| - ) -> None: |
149 |
| - kwargs.setdefault("method", self.upload_method) |
150 |
| - super().put_file( |
151 |
| - from_file, to_info, callback=callback, size=size, **kwargs |
152 |
| - ) |
153 |
| - |
154 | 141 | # pylint: disable=arguments-differ
|
155 | 142 |
|
156 | 143 | def find(self, *args, **kwargs):
|
|
0 commit comments