Skip to content

Error trying to convert Parquet date into Pandas datatype #181

@gallamine

Description

@gallamine

When the Parquet file contains a date type dask_sql will try and convert the corresponding Pandas dataframe column into a date type that Pandas doesn't recognize. The issue seems to arise in https://github.com/nils-braun/dask-sql/blob/main/dask_sql/mappings.py#L273. Example:

import pandas as pd
import dask_sql
from datetime import datetime
df = pd.DataFrame({'date_col':[datetime.today()]})
dask_sql.mappings.cast_column_to_type(df, 'date_col', 'date')

results in TypeError: data type 'date' not understood.
This is after PyArrow has decided that the Parquet date time should be a datetime64[ns] type in Pandas.

I'm using Python 3.7, pyarrow==4.0.0 and pandas==1.2.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions