Skip to content

Commit

Permalink
mypy in pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoGorelli committed Feb 23, 2024
1 parent b0e0997 commit eea8f83
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
7 changes: 6 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,9 @@ repos:
args: [--fix]
# Run the formatter.
- id: ruff-format

- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v1.8.0'
hooks:
- id: mypy
additional_dependencies: ['polars==0.20.10', 'pytest==8.0.1']
exclude: utils
3 changes: 3 additions & 0 deletions narwhals/spec/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ def alias(self, name: str) -> Self:
def cast(self, dtype: DType) -> Self:
...

def __eq__(self, other: object) -> Expr: # type: ignore[override]
...

def __and__(self, other: Any) -> Expr:
...

Expand Down
2 changes: 1 addition & 1 deletion tpch/q1.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
polars.Config.set_tbl_cols(10)


def q1(df_raw: Any) -> None:
def q1(df_raw: Any) -> Any:
var_1 = datetime(1998, 9, 2)
df, pl = to_polars_api(df_raw, version="0.20")
result = (
Expand Down
2 changes: 1 addition & 1 deletion tpch/q4.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
def q4(
lineitem_ds_raw: Any,
orders_ds_raw: Any,
):
) -> Any:
var_1 = datetime(1993, 7, 1)
var_2 = datetime(1993, 10, 1)

Expand Down
2 changes: 1 addition & 1 deletion tpch/q5.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def q5(
lineitem_ds_raw: Any,
orders_ds_raw: Any,
supplier_ds_raw: Any,
):
) -> Any:
var_1 = "ASIA"
var_2 = datetime(1994, 1, 1)
var_3 = datetime(1995, 1, 1)
Expand Down

0 comments on commit eea8f83

Please sign in to comment.