Skip to content

Commit

Permalink
xfail from_dict, from_numpy
Browse files Browse the repository at this point in the history
  • Loading branch information
FBruzzesi committed Jan 8, 2025
1 parent 789a05c commit 2934687
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
12 changes: 8 additions & 4 deletions tests/from_dict_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@


def test_from_dict(constructor: Constructor, request: pytest.FixtureRequest) -> None:
if "dask" in str(constructor):
if "dask" in str(constructor) or "pyspark" in str(constructor):
request.applymarker(pytest.mark.xfail)
df = nw.from_native(constructor({"a": [1, 2, 3], "b": [4, 5, 6]}))
native_namespace = nw.get_native_namespace(df)
Expand All @@ -25,7 +25,7 @@ def test_from_dict(constructor: Constructor, request: pytest.FixtureRequest) ->
def test_from_dict_schema(
constructor: Constructor, request: pytest.FixtureRequest
) -> None:
if "dask" in str(constructor):
if "dask" in str(constructor) or "pyspark" in str(constructor):
request.applymarker(pytest.mark.xfail)
schema = {"c": nw_v1.Int16(), "d": nw_v1.Float32()}
df = nw_v1.from_native(constructor({"a": [1, 2, 3], "b": [4, 5, 6]}))
Expand All @@ -38,7 +38,11 @@ def test_from_dict_schema(
assert result.collect_schema() == schema


def test_from_dict_without_namespace(constructor: Constructor) -> None:
def test_from_dict_without_namespace(
request: pytest.FixtureRequest, constructor: Constructor
) -> None:
if "pyspark" in str(constructor):
request.applymarker(pytest.mark.xfail)
df = nw.from_native(constructor({"a": [1, 2, 3], "b": [4, 5, 6]})).lazy().collect()
result = nw.from_dict({"c": df["a"], "d": df["b"]})
assert_equal_data(result, {"c": [1, 2, 3], "d": [4, 5, 6]})
Expand All @@ -62,7 +66,7 @@ def test_from_dict_one_native_one_narwhals(


def test_from_dict_v1(constructor: Constructor, request: pytest.FixtureRequest) -> None:
if "dask" in str(constructor):
if "dask" in str(constructor) or "pyspark" in str(constructor):
request.applymarker(pytest.mark.xfail)
df = nw_v1.from_native(constructor({"a": [1, 2, 3], "b": [4, 5, 6]}))
native_namespace = nw_v1.get_native_namespace(df)
Expand Down
10 changes: 5 additions & 5 deletions tests/from_numpy_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@


def test_from_numpy(constructor: Constructor, request: pytest.FixtureRequest) -> None:
if "dask" in str(constructor):
if "dask" in str(constructor) or "pyspark" in str(constructor):
request.applymarker(pytest.mark.xfail)
df = nw.from_native(constructor(data))
native_namespace = nw.get_native_namespace(df)
Expand All @@ -31,7 +31,7 @@ def test_from_numpy(constructor: Constructor, request: pytest.FixtureRequest) ->
def test_from_numpy_schema_dict(
constructor: Constructor, request: pytest.FixtureRequest
) -> None:
if "dask" in str(constructor):
if "dask" in str(constructor) or "pyspark" in str(constructor):
request.applymarker(pytest.mark.xfail)
schema = {
"c": nw_v1.Int16(),
Expand All @@ -52,7 +52,7 @@ def test_from_numpy_schema_dict(
def test_from_numpy_schema_list(
constructor: Constructor, request: pytest.FixtureRequest
) -> None:
if "dask" in str(constructor):
if "dask" in str(constructor) or "pyspark" in str(constructor):
request.applymarker(pytest.mark.xfail)
schema = ["c", "d", "e", "f"]
df = nw_v1.from_native(constructor(data))
Expand All @@ -68,7 +68,7 @@ def test_from_numpy_schema_list(
def test_from_numpy_schema_notvalid(
constructor: Constructor, request: pytest.FixtureRequest
) -> None:
if "dask" in str(constructor):
if "dask" in str(constructor) or "pyspark" in str(constructor):
request.applymarker(pytest.mark.xfail)
df = nw.from_native(constructor(data))
native_namespace = nw_v1.get_native_namespace(df)
Expand All @@ -79,7 +79,7 @@ def test_from_numpy_schema_notvalid(


def test_from_numpy_v1(constructor: Constructor, request: pytest.FixtureRequest) -> None:
if "dask" in str(constructor):
if "dask" in str(constructor) or "pyspark" in str(constructor):
request.applymarker(pytest.mark.xfail)
df = nw_v1.from_native(constructor(data))
native_namespace = nw_v1.get_native_namespace(df)
Expand Down

0 comments on commit 2934687

Please sign in to comment.