mmuru edited a comment on pull request #969:
URL: https://github.com/apache/arrow-datafusion/pull/969#issuecomment-913354522
@charliec443: Now, you fixed other date and time related issues. Added test
case looks good. Here is the my test case before your fix.
```
import pyarrow as pa
import pytest
from datafusion import ExecutionContext
from datafusion import functions as f
import datetime
from . import generic as helpers
@pytest.fixture
def df():
ctx = ExecutionContext()
# create a RecordBatch and a new DataFrame from it
batch = pa.RecordBatch.from_arrays(
[helpers.data_datetime("s"),helpers.data_date32(),
helpers.data_date64()],
names=["ts", "dt1", "dt2"],
)
return ctx.create_dataframe([[batch]])
def test_select_ts_date(df):
df = df.select(f.col('ts'),f.col('dt1'),f.col('dt2'))
# execute and collect the first (and only) batch
result = df.collect()[0]
assert result.column(0) == helpers.data_datetime("s")
assert result.column(1) == helpers.data_date32()
assert result.column(2) == helpers.data_date64()
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]