Skip to content

list vs Sequence/Iterable #168

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
hmc-cs-mdrissi opened this issue Jan 18, 2025 · 0 comments
Closed

list vs Sequence/Iterable #168

hmc-cs-mdrissi opened this issue Jan 18, 2025 · 0 comments

Comments

@hmc-cs-mdrissi
Copy link

arrays = [
            pa.array([2.0, 1.0, 0.0, None, None], type=pa.float32()),
        ]
data = pa.RecordBatch.from_arrays(arrays, names=names)

This code fails with a type error of

"list[FloatArray]" is not assignable to "list[Array[Unknown]]"
      Type parameter "_T@list" is invariant, but "FloatArray" is not the same as "Array[Unknown]"

I've seen a couple similar errors for other places where I try to pass list. For pq.ParquetDataset has an error of,

"list[str]" is not assignable to "list[StrPath | NativeFile | IO[Unknown]]"
      Type parameter "_T@list" is invariant, but "str" is not the same as "StrPath | NativeFile | IO[Unknown]"

I'd guess most list in input arguments should be Sequence.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants