Skip to content

Commit 83dd641

Browse files
Apply ruff rule RUF059
RUF059 Unpacked variable is never used
1 parent 2108fe0 commit 83dd641

File tree

9 files changed

+15
-15
lines changed

9 files changed

+15
-15
lines changed

fsspec/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ def open_files(
292292
- For implementations in separate packages see
293293
https://filesystem-spec.readthedocs.io/en/latest/api.html#other-known-implementations
294294
"""
295-
fs, fs_token, paths = get_fs_token_paths(
295+
fs, _fs_token, paths = get_fs_token_paths(
296296
urlpath,
297297
mode,
298298
num=num,

fsspec/implementations/reference.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ def __getitem__(self, key):
391391

392392
def __setitem__(self, key, value):
393393
if "/" in key and not self._is_meta(key):
394-
field, chunk = key.rsplit("/", 1)
394+
field, _chunk = key.rsplit("/", 1)
395395
record, i, _ = self._key_to_record(key)
396396
subdict = self._items.setdefault((field, record), {})
397397
subdict[i] = value

fsspec/implementations/tar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def _get_dirs(self):
118118
def _open(self, path, mode="rb", **kwargs):
119119
if mode != "rb":
120120
raise ValueError("Read-only filesystem implementation")
121-
details, offset = self.index[path]
121+
details, _offset = self.index[path]
122122
if details["type"] != "file":
123123
raise ValueError("Can only handle regular files")
124124
return self.tar.extractfile(path)

fsspec/implementations/tests/test_cached.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@ def test_local_filecache_basic(local_filecache):
699699

700700

701701
def test_local_filecache_does_not_change_when_original_data_changed(local_filecache):
702-
old_data, original_file, cache_location, fs = local_filecache
702+
old_data, original_file, _cache_location, fs = local_filecache
703703
new_data = b"abc"
704704

705705
with fs.open(original_file, "rb") as f:
@@ -899,7 +899,7 @@ def test_filecache_serialization(impl, fs):
899899

900900

901901
def test_add_file_to_cache_after_save(local_filecache):
902-
(data, original_file, cache_location, fs) = local_filecache
902+
(_data, original_file, cache_location, fs) = local_filecache
903903

904904
fs.save_cache()
905905

fsspec/implementations/tests/test_git.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def _check_FileNotFoundError(f, *args, **kwargs):
6767

6868

6969
def test_file_existence_checks(repo):
70-
d, sha = repo
70+
d, _sha = repo
7171

7272
fs, _ = fsspec.url_to_fs(f"git://{d}:abranch@")
7373

@@ -95,7 +95,7 @@ def test_file_existence_checks(repo):
9595

9696

9797
def test_url(repo):
98-
d, sha = repo
98+
d, _sha = repo
9999
fs, _, paths = fsspec.core.get_fs_token_paths(f"git://file1::file://{d}")
100100
assert make_path_posix(d) in make_path_posix(fs.repo.path)
101101
assert paths == ["file1"]

fsspec/tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def do_GET(self):
9393
content_range = f"bytes 0-{len(file_data) - 1}/{len(file_data)}"
9494
if ("Range" in self.headers) and ("ignore_range" not in self.headers):
9595
ran = self.headers["Range"]
96-
b, ran = ran.split("=")
96+
_b, ran = ran.split("=")
9797
start, end = ran.split("-")
9898
if start:
9999
content_range = f"bytes {start}-{end}/{len(file_data)}"

fsspec/tests/test_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def test_class_methods():
4242

4343
def test_multi(m):
4444
m.pipe("/afile", b"data")
45-
fs, token, paths = fsspec.core.get_fs_token_paths(["/afile", "/afile"])
45+
_fs, _token, paths = fsspec.core.get_fs_token_paths(["/afile", "/afile"])
4646
assert len(paths) == 2
4747

4848

fsspec/tests/test_core.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -399,11 +399,11 @@ def test_url_to_fs(ftp_writable):
399399
data = b"hello"
400400
with fsspec.open(f"ftp://{username}:{password}@{host}:{port}/afile", "wb") as f:
401401
f.write(data)
402-
fs, url = fsspec.core.url_to_fs(
402+
_fs, url = fsspec.core.url_to_fs(
403403
f"simplecache::ftp://{username}:{password}@{host}:{port}/afile"
404404
)
405405
assert url == "/afile"
406-
fs, url = fsspec.core.url_to_fs(f"ftp://{username}:{password}@{host}:{port}/afile")
406+
_fs, url = fsspec.core.url_to_fs(f"ftp://{username}:{password}@{host}:{port}/afile")
407407
assert url == "/afile"
408408

409409
with fsspec.open(f"ftp://{username}:{password}@{host}:{port}/afile.zip", "wb") as f:
@@ -414,11 +414,11 @@ def test_url_to_fs(ftp_writable):
414414
f2.write(b"hello")
415415
f.write(data)
416416

417-
fs, url = fsspec.core.url_to_fs(
417+
_fs, url = fsspec.core.url_to_fs(
418418
f"zip://inner::ftp://{username}:{password}@{host}:{port}/afile.zip"
419419
)
420420
assert url == "inner"
421-
fs, url = fsspec.core.url_to_fs(
421+
_fs, url = fsspec.core.url_to_fs(
422422
f"simplecache::zip::ftp://{username}:{password}@{host}:{port}/afile.zip"
423423
)
424424
assert url == ""
@@ -472,7 +472,7 @@ def test_repeated_argument():
472472
pytest.importorskip("adlfs")
473473
from fsspec.core import url_to_fs
474474

475-
fs, url = url_to_fs(
475+
fs, _url = url_to_fs(
476476
"az://[email protected]/DATA",
477477
anon=False,
478478
account_name="ACCOUNT",

fsspec/tests/test_fuse.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ def test_chmod(mount_local):
132132

133133

134134
def test_seek_rw(mount_local):
135-
source_dir, mount_dir = mount_local
135+
_source_dir, mount_dir = mount_local
136136
fh = open(mount_dir / "text", "w")
137137
fh.write("teST")
138138
fh.seek(2)

0 commit comments

Comments
 (0)