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

Apply ruff/flynt rules (FLY) #1719

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion fsspec/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def _signal(self, event):
widget components.
"""
if not self._ignoring_events:
wn = "-".join([event.obj.name, event.name])
wn = f"{event.obj.name}-{event.name}"
if wn in self._map and self._map[wn] in self._sigs:
self._emit(self._map[wn], event.new)

Expand Down
6 changes: 2 additions & 4 deletions fsspec/implementations/reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,7 @@ def __getattr__(self, item):

def setup(self):
self._items = {}
self._items[".zmetadata"] = self.fs.cat_file(
"/".join([self.root, ".zmetadata"])
)
self._items[".zmetadata"] = self.fs.cat_file(f"{self.root}/.zmetadata")
met = json.loads(self._items[".zmetadata"])
self.record_size = met["record_size"]
self.zmetadata = met["metadata"]
Expand Down Expand Up @@ -210,7 +208,7 @@ def create(root, storage_options=None, fs=None, record_size=10000, **kwargs):
if fs.exists(root):
fs.rm(root, recursive=True)
fs.makedirs(root, exist_ok=True)
fs.pipe("/".join([root, ".zmetadata"]), json.dumps(met).encode())
fs.pipe(f"{root}/.zmetadata", json.dumps(met).encode())
return LazyReferenceMapper(root, fs, **kwargs)

@lru_cache()
Expand Down
4 changes: 2 additions & 2 deletions fsspec/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def infer_storage_options(
parsed_path = urlsplit(urlpath)
protocol = parsed_path.scheme or "file"
if parsed_path.fragment:
path = "#".join([parsed_path.path, parsed_path.fragment])
path = f"{parsed_path.path}#{parsed_path.fragment}"
else:
path = parsed_path.path
if protocol == "file":
Expand Down Expand Up @@ -415,7 +415,7 @@ def other_paths(
if exists:
cp = cp.rsplit("/", 1)[0]
if not cp and all(not s.startswith("/") for s in paths):
path2 = ["/".join([path2, p]) for p in paths]
path2 = [f"{path2}/{p}" for p in paths]
else:
path2 = [p.replace(cp, path2, 1) for p in paths]
else:
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ select = [
"E7",
"E9",
"F",
"FLY",
"FURB",
"I",
"LOG",
Expand Down
Loading