harbor run -t openthoughts/tasktrove-swe-rebench-patched-oracle-swe_rebench-03881
harbor download openthoughts/tasktrove-swe-rebench-patched-oracle-swe_rebench-03881
cd /testbed git clone https://github.com/narwhals-dev/narwhals.git . && git checkout bf55d8109f0a7e073572e405bfb2d48f960d0d00 apt-get update apt-get install -y gcc pip install -r /setup_files/requirements.txt pip install -e . pip install pytest
[Bug]: Run into safety assertion on reuse_series_implementation for drop_nulls
reuse_series_implementation
When executing DataFrame.drop_nulls(subset=[...]) we run into safety assertion of reuse_series_implementation function
DataFrame.drop_nulls(subset=[...])
Consider the following tests:
@pytest.mark.parametrize( ("subset", "expected"), [ ("a", {"a": [1, 2.0, 4.0], "b": [float("nan"), 3.0, 5.0]}), (["a"], {"a": [1, 2.0, 4.0], "b": [float("nan"), 3.0, 5.0]}), (["a", "b"], {"a": [2.0, 4.0], "b": [3.0, 5.0]}) ] ) def test_drop_nulls_subset(constructor: Constructor, subset: str | list[str], expected: dict[str, float]) -> None: result = nw.from_native(constructor(data)).drop_nulls(subset=subset) compare_dicts(result, expected)
It will raise for arrow and pandas-like engines, not for polars or dask when subset has more than one column
To not raise
Raise AssertionError
Latest narwhals
No response