From a26abe0e68f480ff57e00b821008ee2c934760e1 Mon Sep 17 00:00:00 2001 From: Benjamin Mako Hill Date: Thu, 6 Aug 2026 15:33:34 -0700 Subject: [PATCH] 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 (cherry picked from commit 7c27942cb0785bd7ca8bd4f69b3e4c10cb8608dc) --- src/wikiq/__init__.py | 6 ++++-- test/Wikiq_Unit_Test.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/wikiq/__init__.py b/src/wikiq/__init__.py index 49ce211..c1ed787 100755 --- a/src/wikiq/__init__.py +++ b/src/wikiq/__init__.py @@ -122,8 +122,10 @@ def build_table( """Build the RevisionTable with appropriate columns based on flags. Returns: - (table, reverts_column) - the table and a reference to the reverts column - (which process() needs for setting the revert detector). + (table, reverts_column, wikitext_parser) - the table, a reference to + 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() diff --git a/test/Wikiq_Unit_Test.py b/test/Wikiq_Unit_Test.py index 4c22eb3..b0bd1bd 100644 --- a/test/Wikiq_Unit_Test.py +++ b/test/Wikiq_Unit_Test.py @@ -38,7 +38,7 @@ setup() def read_jsonl_with_schema(filepath: str, **schema_kwargs) -> pd.DataFrame: """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) pa_table = pj.read_json( filepath,