Skip to content
This repository has been archived by the owner on Nov 22, 2022. It is now read-only.

Use covariant Sequence for select() #394

Closed
jhereth opened this issue Apr 3, 2020 · 0 comments · Fixed by #395
Closed

Use covariant Sequence for select() #394

jhereth opened this issue Apr 3, 2020 · 0 comments · Fixed by #395

Comments

@jhereth
Copy link
Contributor

jhereth commented Apr 3, 2020

Having an array a=["col1", "col2"] the expression df.select(a) we get the following mypy error:

file.py:10: error: Argument 1 to "select" of "DataFrame" has incompatible type "List[str]"; expected "List[Union[Column, str]]"  [arg-type]
file.py:10: note: "List" is invariant -- see http:https://mypy.readthedocs.io/en/latest/common_issues.html#variance
file:10: note: Consider using "Sequence" instead, which is covariant
Found 1 error in 1 file (checked 1 source file)
jhereth added a commit to jhereth/pyspark-stubs that referenced this issue Apr 3, 2020
jhereth added a commit to jhereth/pyspark-stubs that referenced this issue Apr 3, 2020
jhereth added a commit to jhereth/pyspark-stubs that referenced this issue Apr 3, 2020
jhereth added a commit to jhereth/pyspark-stubs that referenced this issue Apr 15, 2020
as @zero323 pointed out in zero323#395 (review),
we can use only List, not Sequence (as originally suggested by mypy)
jhereth added a commit to jhereth/pyspark-stubs that referenced this issue Apr 15, 2020
as @zero323 pointed out in zero323#395 (review),
we can use only List, not Sequence (as originally suggested by mypy)
zero323 added a commit that referenced this issue Apr 16, 2020
as @zero323 pointed out in #395 (review),
we can use only List, not Sequence (as originally suggested by mypy)

Co-authored-by: Maciej <[email protected]>
zero323 added a commit that referenced this issue Apr 28, 2020
as @zero323 pointed out in #395 (review),
we can use only List, not Sequence (as originally suggested by mypy)

Co-authored-by: Maciej <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant