Skip to content

Ibis map dtype #2201

@mark-druffel

Description

@mark-druffel

Is your feature request related to a problem? Please describe.
I totally screw this up initially so correcting it, sorry for all the confusion @deepyaman!

Ibis dtype map is not implemented, not sure exactly what the proper syntax would be but here's what I was thinking:

import ibis
import pandera.ibis as pa
import pandas as pd

data = pd.DataFrame({
    "id": ["01", "02", "03"],
    "dict_col": [{
        1: "value_1A",
        2: "value_1B",
        3: "value_1C"
    },
    {
        1: "value_2A",
        2: "value_2B",
    },
    None]
})
df = ibis.memtable(data)

class ValidateSchema(pa.DataFrameModel):
    id: str = pa.Field(nullable=False)
    dict_col: ibis.dtype("map<string, string>") = pa.Field(nullable=True)
ValidateSchema.validate(data)

> TypeError: Data type 'object' not understood by Engine.

Describe the solution you'd like
Implement Ibis Map in ibis_engine.py.

Describe alternatives you've considered
I don't think there's a workaround other than using the pyspark dataframe underneath ibis for validations which is a separate can of worms for us.

Additional context
Add any other context or screenshots about the feature request here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions