Skip to content

fix(parquet/pqarrow): return an error on pqarrow write calls if the writer is already closed - #728

Merged
zeroshade merged 1 commit into
apache:mainfrom
alexandre-normand:fix-pqwriter-write-after-close
Mar 26, 2026
Merged

zeroshade merged 1 commit into
apache:mainfrom
alexandre-normand:fix-pqwriter-write-after-close

Conversation

@alexandre-normand

Copy link
Copy Markdown
Contributor

Rationale for this change

Currently, the pqarrow FileWriter ignores the closed status of the FileWriter and write calls are attempted which can lead to surprising and hard to understand errors as noted in issue #727 . Returning a clear error stating the FileWriter is already closed should help nudge users about their misuse of the API (or provide an indicator of a potential race condition between invocations of Write calls and Close). .

What changes are included in this PR?

Adds a check on all FileWriter write methods to validate is a FileWriter is already closed to return a clear error and short-circuit the write execution.

Are these changes tested?

Yes, a unit tested was added to validate the behavior.

Are there any user-facing changes?

resolves #727

@zeroshade zeroshade changed the title fix(pqarrow): return an error on pqarrow write calls if the writer is already closed fix(parquet/pqarrow): return an error on pqarrow write calls if the writer is already closed Mar 26, 2026
@zeroshade
zeroshade merged commit d5f0c34 into apache:main Mar 26, 2026
5 checks passed
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 this pull request may close these issues.

[pqarrow] pqarrow.FileWriter.WriteBuffered returns "unknown error type: interface conversion: interface is nil, not encoding.Encoder[int64]"

2 participants