Skip to content

Commit 2dd338d

Browse files
Arsh ZahedArsh Zahed
authored andcommitted
Add test_check_jsonl_extra_column
1 parent 7529a38 commit 2dd338d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/unit/test_files_checks.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,3 +279,14 @@ def test_check_jsonl_wrong_turn_type(tmp_path: Path):
279279
"Invalid format on line 1 of the input file. Expected a dictionary"
280280
in report["message"]
281281
)
282+
283+
284+
def test_check_jsonl_extra_column(tmp_path: Path):
285+
file = tmp_path / "extra_column.jsonl"
286+
content = [{"text": "Hello, world!", "extra_column": "extra"}]
287+
with file.open("w") as f:
288+
f.write("\n".join(json.dumps(item) for item in content))
289+
290+
report = check_file(file)
291+
assert not report["is_check_passed"]
292+
assert "Found extra column" in report["message"]

0 commit comments

Comments
 (0)