From f5807c936b118dcbebc883852f3f7a4a46e66f67 Mon Sep 17 00:00:00 2001 From: AI Assistant Date: Sat, 1 Aug 2026 10:51:36 -0300 Subject: [PATCH] fix: suppress warnings for intentional extraction skips --- graphify/extract.py | 2 +- tests/test_zero_node_no_cache.py | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/graphify/extract.py b/graphify/extract.py index 300a59618..8d211d820 100644 --- a/graphify/extract.py +++ b/graphify/extract.py @@ -4608,7 +4608,7 @@ def extract( _empty_sources: list[str] = [] for i, _p in enumerate(paths): _res = per_file[i] or {} - if _res.get("nodes") or _res.get("error"): + if _res.get("nodes") or _res.get("error") or _res.get("skipped"): continue if _get_extractor(_p) is not None: _empty_sources.append(str(_p)) diff --git a/tests/test_zero_node_no_cache.py b/tests/test_zero_node_no_cache.py index 5e62547ba..56ffb4ac3 100644 --- a/tests/test_zero_node_no_cache.py +++ b/tests/test_zero_node_no_cache.py @@ -52,3 +52,16 @@ def test_no_warning_when_all_files_produce_nodes(tmp_path, capsys): ex.extract([f], cache_root=tmp_path / "out", parallel=False) err = capsys.readouterr().err assert "zero nodes" not in err + + +def test_intentionally_skipped_data_json_does_not_warn(tmp_path, capsys): + """Data-shaped JSON is deliberately excluded from the code graph, so its + explicit ``skipped`` result must not be reported as a failed extraction that + will retry forever.""" + f = tmp_path / "records.json" + f.write_text('[{"id": 1}, {"id": 2}]\n', encoding="utf-8") + + result = ex.extract([f], cache_root=tmp_path / "out", parallel=False) + + assert result["nodes"] == [] + assert "zero nodes" not in capsys.readouterr().err