Skip to content

Commit 2a40f36

Browse files
TYP: Enforce 100% type completeness score (PyRight) (#2564)
Co-authored-by: Dan Redding <[email protected]>
1 parent 2f246df commit 2a40f36

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

.github/workflows/typing.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,9 @@ jobs:
4545
run: |
4646
source .venv/bin/activate
4747
pyright
48+
- name: Run pyright type completeness
49+
run: |
50+
source .venv/bin/activate
51+
output=$(pyright --verifytypes narwhals --ignoreexternal 2>&1)
52+
echo "$output"
53+
echo "$output" | grep "Type completeness score: 100%" || exit 1

narwhals/_expression_parsing.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -254,14 +254,14 @@ def __init__(
254254
assert is_scalar_like # noqa: S101 # debug assertion
255255
if is_elementwise:
256256
assert preserves_length # noqa: S101 # debug assertion
257-
self.expansion_kind = expansion_kind
258-
self.last_node = last_node
259-
self.has_windows = has_windows
260-
self.n_orderable_ops = n_orderable_ops
261-
self.is_elementwise = is_elementwise
262-
self.preserves_length = preserves_length
263-
self.is_scalar_like = is_scalar_like
264-
self.is_literal = is_literal
257+
self.expansion_kind: ExpansionKind = expansion_kind
258+
self.last_node: ExprKind = last_node
259+
self.has_windows: bool = has_windows
260+
self.n_orderable_ops: int = n_orderable_ops
261+
self.is_elementwise: bool = is_elementwise
262+
self.preserves_length: bool = preserves_length
263+
self.is_scalar_like: bool = is_scalar_like
264+
self.is_literal: bool = is_literal
265265

266266
def __init_subclass__(cls, /, *args: Any, **kwds: Any) -> Never: # pragma: no cover
267267
msg = f"Cannot subclass {cls.__name__!r}"

0 commit comments

Comments
 (0)