Skip to content

Commit

Permalink
fix: exclude protocols in api completeness script (#1635)
Browse files Browse the repository at this point in the history
  • Loading branch information
FBruzzesi authored Dec 21, 2024
1 parent 7a19378 commit 9c69d7d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@


def run_common(session: Session, coverage_threshold: float) -> None:
session.install('-e ".[dev]"')
session.install("-e .[dev]")

if session.python != "3.8":
session.install("ibis-framework>=6.0.0", "rich", "packaging", "pyarrow_hotfix")
Expand Down
7 changes: 6 additions & 1 deletion utils/generate_backend_completeness.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,13 @@ def parse_module(module_name: str, backend: str, nw_class_name: str) -> list[str
module_ = importlib.import_module(f"narwhals.{backend}.{module_name}")
class_ = inspect.getmembers(
module_,
predicate=lambda c: inspect.isclass(c) and c.__name__.endswith(nw_class_name),
predicate=lambda c: (
inspect.isclass(c)
and c.__name__.endswith(nw_class_name)
and not c.__name__.startswith("Compliant") # Exclude protocols
),
)

methods_ = (
get_class_methods(class_[0][1]) + DIRECTLY_IMPLEMENTED_METHODS
if class_
Expand Down

0 comments on commit 9c69d7d

Please sign in to comment.