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

Marks xfail xgboost test due to scikit lib issue #1255

Merged
merged 2 commits into from
Dec 12, 2024
Merged
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
1 change: 1 addition & 0 deletions tests/plugins/test_xgboost_extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def test_xgboost_model_json_writer(
assert metadata[FILE_METADATA]["path"] == str(model_path)


@pytest.mark.xfail(condition=True, reason="scikitlearn library incompatibility issue", strict=False)
def test_xgboost_model_json_reader(
fitted_xgboost_model: xgboost.XGBModel, tmp_path: pathlib.Path
) -> None:
Expand Down
6 changes: 4 additions & 2 deletions tests/test_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,15 @@ def annotated_func(first: ArrayN[np.float64], other: float = 2.0) -> ArrayN[np.f

node = Node.from_fn(annotated_func)
assert node.name == "annotated_func"
if major == 2 and minor > 1: # greater that 2.1
if major == 2 and minor > 1 and sys.version_info > (3, 9): # greater that 2.1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The condition sys.version_info > (3, 9) should be sys.version_info >= (3, 9) to correctly include Python 3.9 and above.

expected = {
"first": (
Annotated[np.ndarray[tuple[int, ...], np.dtype[np.float64]], Literal["N"]],
DependencyType.REQUIRED,
),
"other": (float, DependencyType.OPTIONAL),
}
expected_type = Annotated[np.ndarray[tuple[int, ...], np.dtype[np.float64]], Literal["N"]]
else:
expected = {
"first": (
Expand All @@ -76,8 +77,9 @@ def annotated_func(first: ArrayN[np.float64], other: float = 2.0) -> ArrayN[np.f
),
"other": (float, DependencyType.OPTIONAL),
}
expected_type = Annotated[np.ndarray[Any, np.dtype[np.float64]], Literal["N"]]
assert node.input_types == expected
assert node.type == Annotated[np.ndarray[tuple[int, ...], np.dtype[np.float64]], Literal["N"]]
assert node.type == expected_type


@pytest.mark.parametrize(
Expand Down