Skip to content

Commit

Permalink
Add xfail test for df.astype(pa.DictionaryType)
Browse files Browse the repository at this point in the history
Demonstration of
#2187
  • Loading branch information
NickCrews committed Aug 29, 2022
1 parent d5c096a commit b994b54
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tests/astype_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from common import *
import collections
import numpy as np

def test_astype(ds_local):
Expand Down Expand Up @@ -35,6 +34,18 @@ def test_astype_numeric(array_factory):
assert df.x.astype('int').tolist() == [1, 2, None]


@pytest.mark.xfail
def test_astype_dictionary(df_factory):
arr = pa.array(["one", "two", "one"]).dictionary_encode()
# With just strings, it works fine:
# arr = pa.array(["one", "two", "one"])
df = df_factory(x=arr)
# These work
df["x"].astype(df["x"].dtype).nop()
df["x"].astype(vaex.datatype.DataType(arr.type)).nop()
# This doesn't
df["x"].astype(arr.type).nop()


def test_astype_dtype():
df = vaex.from_arrays(x=[0, 1])
Expand Down

0 comments on commit b994b54

Please sign in to comment.