Skip to content

Commit e25445e

Browse files
igerberclaude
andcommitted
Fix doc-snippet test failures from PR 2.5 plot_bacon insertion
CI's "Validate RST code snippets" job failed with 2 errors after the plot_bacon section was inserted in docs/api/visualization.rst: 1. block8 (new plot_bacon example) used wrong API: BaconDecomposition.fit() takes first_treat=, not treatment=. Fixed to first_treat='first_treat'. 2. block9 (Plotly Backend, was block8 before insertion) raised NameError on 'results' because it relies on context from earlier blocks. The _CONTEXT_DEPENDENT_SNIPPETS allowlist had api_visualization:block8 which now points to my new plot_bacon block (which is standalone and does NOT need leniency); the actual context-dependent block moved to index 9. Updated allowlist entry to api_visualization:block9. Verified locally: both blocks now pass under PYTHONPATH=. DIFF_DIFF_BACKEND=python pytest Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 10eff92 commit e25445e

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

docs/api/visualization.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ Example
204204
205205
bd = BaconDecomposition()
206206
results = bd.fit(data, outcome='y', unit='unit_id',
207-
time='period', treatment='treated')
207+
time='period', first_treat='first_treat')
208208
209209
# Scatter of 2x2 comparisons by weight, colored by comparison type
210210
ax = plot_bacon(results)

tests/test_doc_snippets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ def _restore_datasets_module():
358358
"api_bacon:block2",
359359
"api_visualization:block2",
360360
"api_visualization:block3",
361-
"api_visualization:block8",
361+
"api_visualization:block9",
362362
"python_comparison:block5",
363363
"quickstart:block3",
364364
"quickstart:block9",

0 commit comments

Comments
 (0)