fix test helper for build_table's three-value return

build_table returns (table, reverts_column, wikitext_parser) but the
jsonl test helper still unpacked two values, so test_jsonl_noargs and
test_jsonl_tsv_equivalence failed with a ValueError before reading any
output. Also update the docstring, which still described the two-value
return.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
(cherry picked from commit 7c27942cb0)
This commit is contained in:
2026-08-06 15:33:34 -07:00
parent 97e21e3634
commit a26abe0e68
2 changed files with 5 additions and 3 deletions

View File

@@ -122,8 +122,10 @@ def build_table(
"""Build the RevisionTable with appropriate columns based on flags. """Build the RevisionTable with appropriate columns based on flags.
Returns: Returns:
(table, reverts_column) - the table and a reference to the reverts column (table, reverts_column, wikitext_parser) - the table, a reference to
(which process() needs for setting the revert detector). the reverts column (which process() needs for setting the revert
detector), and the wikitext parser (None unless a wikitext-parsing
column was requested).
""" """
reverts_column = tables.RevisionReverts() reverts_column = tables.RevisionReverts()

View File

@@ -38,7 +38,7 @@ setup()
def read_jsonl_with_schema(filepath: str, **schema_kwargs) -> pd.DataFrame: def read_jsonl_with_schema(filepath: str, **schema_kwargs) -> pd.DataFrame:
"""Read JSONL file using PyArrow with explicit schema from wikiq.""" """Read JSONL file using PyArrow with explicit schema from wikiq."""
table, _ = build_table(**schema_kwargs) table, _, _ = build_table(**schema_kwargs)
schema = build_schema(table, **schema_kwargs) schema = build_schema(table, **schema_kwargs)
pa_table = pj.read_json( pa_table = pj.read_json(
filepath, filepath,