@pytest.mark.parametrize('na_position', ['first', 'last'])
@pytest.mark.parametrize('ascending', [True, False])
@pytest.mark.parametrize('by', ['a', 'b'])
@pytest.mark.parametrize('nparts', [1, 5])
@pytest.mark.parametrize('data', [{'a': ((list(range(50)) + ([None] * 50)) + list(range(50, 100))), 'b': (([None] * 100) + list(range(100, 150)))}, {'a': (list(range(15)) + ([None] * 5)), 'b': list(reversed(range(20)))}])
def test_sort_values_with_nulls(data, nparts, by, ascending, na_position):
    df = pd.DataFrame(data)
    ddf = dd.from_pandas(df, npartitions=nparts)
    with dask.config.set(scheduler='single-threaded'):
        got = ddf.sort_values(by=by, ascending=ascending, na_position=na_position)
    expect = df.sort_values(by=by, ascending=ascending, na_position=na_position)
    dd.assert_eq(got, expect, check_index=False)
@pytest.mark.parametrize('na_position', ['first', 'last'])
@pytest.mark.parametrize('ascending', [True, False])
@pytest.mark.parametrize('by', ['a', 'b'])
@pytest.mark.parametrize('nparts', [1, 5])
@pytest.mark.parametrize('data', [{'a': ((list(range(50)) + ([None] * 50)) + list(range(50, 100))), 'b': (([None] * 100) + list(range(100, 150)))}, {'a': (list(range(15)) + ([None] * 5)), 'b': list(reversed(range(20)))}])
def test_sort_values_with_nulls(data, nparts, by, ascending, na_position):
    df = pd.DataFrame(data)
    ddf = dd.from_pandas(df, npartitions=nparts)
    with dask.config.set(scheduler='single-threaded'):
        got = ddf.sort_values(by=by, ascending=ascending, na_position=na_position)
    expect = df.sort_values(by=by, ascending=ascending, na_position=na_position)
    dd.assert_eq(got, expect, check_index=False)