Skip to content

Sampling fails for columns of dtype Array(List(...), ...) #243

Description

@jjurm

Consider:

def test_sample_array_list(arr_size, n_samples):
    class TestSchema(dy.Schema):
        a = dy.Array(dy.List(dy.Bool()), arr_size)
    TestSchema.sample(n_samples, generator=dy.random.Generator(0))

On dataframely==2.3.1:

  • calling test_sample_array_list(2, 1)
    fails with polars.exceptions.InvalidOperationError: cannot reshape array of size 49 into shape (1, 2)
  • and calling test_sample_array_list(1, 1)
    fails with polars.exceptions.SchemaError: type Boolean is incompatible with expected type List(Boolean)

I'd expect both to pass.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions