Skip to content

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

@jjurm

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.

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions