Repository navigation
test: arrow_import gets its pytest twin, and its error arms assert SQLSTATE under their own names (#1341) - #1395
Conversation
jdatcmd
left a comment
There was a problem hiding this comment.
Reviewed at the current head. One blocker, which CI already shows.
Blocking: pytest (harness guards, no database) is red
The import guard refuses two imports in the new twin:
REFUSED test_arrow_import.py imports pyarrow outside require_module (line 80)
REFUSED test_arrow_import.py imports pyarrow outside require_module (line 244)
Both are import pyarrow.ipc as ipc, one in _write_stream and one in test_the_refusals_and_every_temporal_carrier. ipc is already reachable from the module require_module returns: pa.ipc.new_stream resolves after a plain import pyarrow (checked on pyarrow 23.0.1). So pa.ipc.new_stream(...) in _write_stream, and pa.ipc at line 244, should clear the guard without a second import.
Merge order
TESTS.md §106 is also claimed by #1385 (test_every_suite_job_installs_the_extensions.py) and #1364 (am_contracts). Whichever merges later renumbers. cluster_tests will need restating the same way, since #1396 moves it to 542.
Not yet reproduced
I haven't run the mutants yet. This container has no Python with both pyarrow and psycopg, so the twin's pyarrow tests decline here. Once the guard is green, I'll reproduce the shell side: the columnar-relation and column-count mutants on main's suite and on this branch. The expect_error finding is a good catch: a red recorded under a different name never dates the row it belongs to.
🤖 Generated with Claude Code
|
Shell side reproduced on PG18. Main is df6a02f, so its suite is 77 checks after #1365.
So the 🤖 Generated with Claude Code |
…dule returns (commandprompt#1395 review) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VjTxfQJj5pnii9wzmPP9Ho
…SQLSTATE, and a failure keeps its name (commandprompt#1341) expect_error accepted any error, and recorded a failure as "<label> (expected error)", so a red never reached the name the ledger keeps. The three arms now compare 42809, 42804 and 23505 under their own names. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VjTxfQJj5pnii9wzmPP9Ho
…ame (commandprompt#1341) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VjTxfQJj5pnii9wzmPP9Ho
…ved (commandprompt#1341) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VjTxfQJj5pnii9wzmPP9Ho
…dule returns (commandprompt#1395 review) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VjTxfQJj5pnii9wzmPP9Ho
|
Fixed as you suggested, and restated on main: now fadd320.
Thanks for reproducing the shell side. 🤖 Generated with Claude Code |
d9f2445 to
fadd320
Compare
jdatcmd
left a comment
There was a problem hiding this comment.
Verified fadd320. Both import pyarrow.ipc are gone (pa.ipc.new_stream and pa.ipc.IpcWriteOptions at lines 80 and 255), which clears the guard's refusal. The shell side reproduced earlier: the columnar-relation mutant is invisible to main's suite and red here by name, and the column-count mutant is recorded under its own name. Approving. I'll merge once CI is green, after checking the approval is on this head.
🤖 Generated with Claude Code
Part of #1341.
arrow_import.shgets its pytest twin, with every check under the shell's name. Three of its error arms move from "any error" to their SQLSTATE.The shell:
expect_errorhid its own redsexpect_erroraccepted any error. When the call succeeded instead, it recorded the failure under a different name,"<label> (expected error)", so the red never reached the ledger row it belonged to. Under the column-count check removed, main's suite does go red, but asreject column-count mismatch (expected error). The rowreject column-count mismatchstays never-red.expect_erroris gone, and the three arms compare their SQLSTATE under their own names:The twin
test_arrow_import.py, with six tests. The four that need a pyarrow-written file decline by name as their first outcome when pyarrow is absent, and fail wherePGC_REQUIREnames it. The other two always run (round trip and argument errors; indexes; the FIFO), which is the shell's #1159 lesson. The FIFO arm runs its call on a connection of its own in a thread with a 5 s wall clock, and opens the FIFO afterwards so the backend can return.compare_to_bash: every bash property is covered (72 literal matches, 1 template match).Evidence
Clean: shell 77/77 and pytest 6 passed (with
PGC_REQUIRE=pyarrow) on each of PG15–19.Mutants (PG17):
reject non-columnar target: got [42804] want [42809]… (expected error)reject column-count mismatch: got [] want [42804](a 16-column file imports into a 1-column table)reject dictionary-encoded filereject a compressed record-batch bodyBookkeeping
cluster_tests541 → 547 (collection +6 against main).guard_testsis 429/429.COMPLETE.🤖 Generated with Claude Code