Skip to content

Commit

Permalink
pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelzw committed Aug 8, 2024
1 parent 6e0566e commit 77bfe1e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 37 deletions.
12 changes: 7 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ pyarrow = [
packages = ["src/pydiverse"]

[tool.ruff]
target-version = "py38"
extend-exclude = ["docs/*"]
fix = true

[tool.ruff.lint]
select = [
"F",
"E",
Expand All @@ -47,16 +52,13 @@ ignore = [
"A001", # Keep while filter verb still is called filter
"A003", # Keep while filter verb still is called filter
]
extend-exclude = ["docs/*"]
ignore-init-module-imports = true
fix = true
target-version = "py38"

[tool.ruff.per-file-ignores]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401", "F403"]
"tests/*" = ["F403", "F405", "E711"]

[tool.ruff.isort]
[tool.ruff.lint.isort]
known-first-party = ["pydiverse"]
required-imports = ["from __future__ import annotations"]

Expand Down
41 changes: 15 additions & 26 deletions src/pydiverse/transform/core/table_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,41 +175,29 @@ def preverb_hook(self, verb: str, *args, **kwargs) -> None:
"""
...

def alias(self, name=None) -> AbstractTableImpl:
...
def alias(self, name=None) -> AbstractTableImpl: ...

def collect(self):
...
def collect(self): ...

def build_query(self):
...
def build_query(self): ...

def select(self, *args):
...
def select(self, *args): ...

def mutate(self, **kwargs):
...
def mutate(self, **kwargs): ...

def join(self, right, on, how, *, validate=None):
...
def join(self, right, on, how, *, validate=None): ...

def filter(self, *args):
...
def filter(self, *args): ...

def arrange(self, ordering: list[OrderingDescriptor]):
...
def arrange(self, ordering: list[OrderingDescriptor]): ...

def group_by(self, *args):
...
def group_by(self, *args): ...

def ungroup(self, *args):
...
def ungroup(self, *args): ...

def summarise(self, **kwargs):
...
def summarise(self, **kwargs): ...

def slice_head(self, n: int, offset: int):
...
def slice_head(self, n: int, offset: int): ...

#### Symbolic Operators ####

Expand Down Expand Up @@ -292,8 +280,9 @@ def _translate_case_common(
else:
# AGGREGATE and EWISE are incompatible
raise FunctionTypeError(
"Incompatible function types found in case statement: "
", ".join(val_ftypes)
"Incompatible function types found in case statement: " ", ".join(
val_ftypes
)
)

if result_ftype is OPType.EWISE and switching_on is not None:
Expand Down
8 changes: 2 additions & 6 deletions src/pydiverse/transform/core/util/bidict.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,8 @@ def __init__(self, seq: Mapping[KT, VT] = None, /, *, fwd=None, bwd=None):
" unique."
)

self.fwd = _BidictInterface(
self.__fwd, self.__bwd
) # type: _BidictInterface[KT, VT]
self.bwd = _BidictInterface(
self.__bwd, self.__fwd
) # type: _BidictInterface[VT, KT]
self.fwd = _BidictInterface(self.__fwd, self.__bwd) # type: _BidictInterface[KT, VT]
self.bwd = _BidictInterface(self.__bwd, self.__fwd) # type: _BidictInterface[VT, KT]

def __copy__(self):
return bidict(fwd=self.__fwd.copy(), bwd=self.__bwd.copy())
Expand Down

0 comments on commit 77bfe1e

Please sign in to comment.