Skip to content
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

pyarrow.parquet.write_table mypy failures since 17.0 #97

Closed
rainsville opened this issue Sep 20, 2024 · 1 comment · Fixed by #98
Closed

pyarrow.parquet.write_table mypy failures since 17.0 #97

rainsville opened this issue Sep 20, 2024 · 1 comment · Fixed by #98

Comments

@rainsville
Copy link

Since the refactor in #35, we are getting mypy failures for code that runs correctly:

from io import BytesIO

import pyarrow
import pyarrow.parquet as pyparquet

writer = pyarrow.BufferOutputStream()
table = pyarrow.Table.from_pandas(dataframe)
pyparquet.write_table(table=table, where=writer, compression="GZIP")
buffer = BytesIO(writer.getvalue())

error: Argument "where" to "write_table" has incompatible type "BufferOutputStream"; expected "str | Path | IO[Any]" [arg-type]
error: Argument "compression" to "write_table" has incompatible type "Literal['GZIP']"; expected "Literal['gzip', 'bz2', 'brotli', 'lz4', 'lz4_frame', 'lz4_raw', 'zstd', 'snappy']" [arg-type]
error: Argument 1 to "BytesIO" has incompatible type "pyarrow.__lib_pxi.io.Buffer"; expected "_collections_abc.Buffer" [arg-type]

@zen-xu zen-xu linked a pull request Sep 21, 2024 that will close this issue
@zen-xu zen-xu reopened this Sep 21, 2024
@zen-xu
Copy link
Owner

zen-xu commented Sep 21, 2024

error1: fixed in #98
error2: for the compression parameter, please use lowercase
error3: fixed in #99

@zen-xu zen-xu closed this as completed Sep 21, 2024
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

Successfully merging a pull request may close this issue.

2 participants