Skip to content

Commit

Permalink
rename accessor tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mrocklin committed Jun 25, 2015
1 parent a6962a9 commit d018402
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions dask/dataframe/tests/test_dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,19 +509,23 @@ def test_embarrassingly_parallel_operations():
assert len(a.sample(0.5).compute()) < len(df)


def test_datetime():
def test_datetime_accessor():
df = pd.DataFrame({'x': [1, 2, 3, 4]})
df['x'] = df.x.astype('M8[us]')

a = dd.from_pandas(df, 2)

assert 'date' in dir(a.x.dt)

assert eq(a.x.dt.date, df.x.dt.date)
assert (a.x.dt.to_pydatetime().compute() == df.x.dt.to_pydatetime()).all()


def test_datetime():
def test_str_accessor():
df = pd.DataFrame({'x': ['a', 'b', 'c', 'D']})

a = dd.from_pandas(df, 2)

assert 'upper' in dir(a.x.str)

assert eq(a.x.str.upper(), df.x.str.upper())

0 comments on commit d018402

Please sign in to comment.