Repository navigation
Conversation
ArrowIPCWriter's constructor dropped the Status returned by setup(), so a failed FileOutputStream::Open (a directory at the target path, a read-only location, a file Windows keeps mapped for a live pyarrow table) left writer_ unassigned. The first write then called ValueOrDie on it and aborted the Python interpreter. ParquetWriter dropped the FileWriter::Open status the same way. Both constructors now throw when setup() fails, naming the output path and Arrow's message, and WriterFactory::create_writer returns that message as its error. Every caller of create_arrow_file already turns that error into a failed run, so featurize() raises RuntimeError and the CLI exits non-zero. ParquetWriter's open goes through the same Status path instead of PARQUET_ASSIGN_OR_THROW, and the IPC writer also checks MakeFileWriter's result. Tests: - TEST_ARROW_IPC_UNOPENABLE_PATH_MECHANICS and TEST_ARROW_PARQUET_UNOPENABLE_PATH_MECHANICS: create_arrow_file on a path that is a directory reports failure naming the path, and the same stream then writes a readable file to a writable path. Both fail without the fix (IPC returns success; Parquet lets the exception escape create_arrow_file). - test_arrow_unopenable_path_raises (arrowipc, parquet) and the Windows-only test_arrow_ipc_mapped_file_raises: featurize() raises RuntimeError, then writes the file once the path is usable. The arrowipc cases abort the interpreter without the fix. Closes PN-279.
darkclad
force-pushed
the
main-arrow-open-error
branch
from
November 3, 2026 20:41
a768584 to
20810ff
Compare
vjaganat90
approved these changes
Nov 6, 2026
vjaganat90
left a comment
Member
There was a problem hiding this comment.
LGTM.
Nit, in a file this PR doesn't touch: tests/vetting/not_covered.md still counts the Arrow tests as they were before this PR.
- Line 33:
test_arrow_mechanics.hnow has 4 test functions, not 2, so the section A total on line 20 becomes 107. - B.3: the
USE_ARROWrow should listTEST_ARROW_IPC_UNOPENABLE_PATH_MECHANICSandTEST_ARROW_PARQUET_UNOPENABLE_PATH_MECHANICS, which makes 15 cases. - B.4: could add that
test_arrow_ipc_mapped_file_raisesruns on Windows only.
test_arrow_mechanics.h has 4 test functions. Section A's total is the sum of its tables, 113 functions. B.3 lists the two new USE_ARROW cases and totals what test_all.cc registers under a build flag: 5 USE_ARROW, 61 OMEZARR_SUPPORT and 7 DICOM_SUPPORT, 73 cases. The OMEZARR_SUPPORT row describes its cases by name pattern. B.4 records that test_arrow_ipc_mapped_file_raises runs on Windows only.
Author
|
Diverted Updated the Arrow row, the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When nyxus cannot open its Arrow IPC output file for writing,
featurize(..., output_type="arrowipc")aborts the Python interpreter instead of raising:ArrowIPCWriter's constructor dropped theStatusreturned bysetup(). After a failedFileOutputStream::Open,writer_stayed unassigned, and the firstwrite()dereferenced it.ParquetWriterdropped theFileWriter::Openstatus the same way.The open can fail when the target is a directory, the location is read-only, or Windows still has the file mapped for a live pyarrow table. On PR #529's Windows wheel jobs, the last case aborted the test run and cut off pytest's failure summary.
Changes
ParquetWriterandArrowIPCWriterconstructors throwstd::runtime_errorwhensetup()fails. The message names the output path and includes Arrow's error.WriterFactory::create_writercatches that and returns the message through its existing error slot. Every caller ofcreate_arrow_filealready turns that error into a failed run, so:featurize()raisesRuntimeError;ParquetWriter::setupopens the file throughARROW_ASSIGN_OR_RAISEinstead ofPARQUET_ASSIGN_OR_THROW, so both writers report a failed open the same way.ArrowIPCWriter::setupnow returnsMakeFileWriter's status.Example of the new error:
Tests
TEST_ARROW_IPC_UNOPENABLE_PATH_MECHANICScreate_arrow_fileon a path that is a directory returns failure naming the path; the same stream then writes and reads back a file at a writable pathTEST_ARROW_PARQUET_UNOPENABLE_PATH_MECHANICScreate_arrow_filetest_arrow_unopenable_path_raises[arrowipc]featurize()raisesRuntimeErrornaming the file, then writes to a writable pathtest_arrow_unopenable_path_raises[parquet]test_arrow_ipc_mapped_file_raises(Windows only)featurize()raises, and the write succeeds once the table is releasedA directory at the target path is the unopenable fixture because no platform opens a directory for writing.
Closes PN-279.