Skip to content

Bug: Roundtrip a collection with parquet fails with dy.Any #314

@gab23r

Description

@gab23r

dy.Any columns should be ignored in the validation when reading from a parquet file.

from pathlib import Path
import dataframely as dy
import polars as pl

class S(dy.Schema):
    a = dy.Any()

class C(dy.Collection):
    df : dy.LazyFrame[S]

df = pl.DataFrame({"a": 0})
collection = C.validate({"df": df})


Path("./tmp").mkdir(exist_ok=True)
collection.write_parquet("./tmp")
collection.read_parquet("./tmp").df.collect()

# InvalidOperationError: conversion from `i64` to `null` failed in column 'a' for 1 out of 1 values: [0]

# This error occurred in the following expression:
# 	col("a").strict_cast(Null)

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