Skip to content

Conversation

@s3alfisc
Copy link
Member

Add snapshot tests for etable and coefplot / iplot via syrupy.

@s3alfisc s3alfisc requested a review from Copilot December 25, 2025 16:09
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds comprehensive snapshot tests for etable and plotting functionality (coefplot/iplot) via syrupy, and migrates internal table generation from custom code to the maketables package.

Key Changes

  • Migrated table functionality to use maketables package internally, replacing custom implementations
  • Added snapshot tests for etable output across multiple formats (gt, tex, md, df, html)
  • Added snapshot tests for coefplot/iplot across matplotlib and lets_plot backends
  • Deprecated pf.dtable() and removed pf.make_table() in favor of maketables equivalents

Reviewed changes

Copilot reviewed 20 out of 24 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/test_plots_snapshot.py New comprehensive snapshot tests for coefplot/iplot visual output
tests/test_etable_snapshot.py New comprehensive snapshot tests for etable output formats
tests/test_plots.py Removed (replaced by snapshot tests)
tests/test_summarise.py Updated etable test calls to use new file_name parameter
tests/test_dtable.py Updated expected values for maketables formatting and added deprecation warning test
tests/texfiles/test.tex Updated expected LaTeX output reflecting new maketables formatting
pyfixest/report/summarize.py Refactored to delegate to maketables for table generation
pyfixest/report/make_table.py Removed (functionality moved to maketables)
pyfixest/report/init.py Removed make_table export
pyfixest/estimation/decomposition.py Updated to use maketables.MTable
pyfixest/estimation/feols_.py Added type ignore comment for pandas typing
pyfixest/did/lpdid.py Added type ignore comments for pandas typing
pyproject.toml Replaced great_tables with maketables dependency, added snapshot marker
pixi.toml Added snapshot environment with syrupy and lets-plot dependencies
pytest.ini Added snapshot marker definition
docs/table-layout.qmd Updated documentation for maketables migration
docs/quarto_example/QuartoExample.qmd Added tabularx package requirement
docs/changelog.qmd Documented migration to maketables with guide
.github/workflows/snapshot-tests.yaml New CI workflow for snapshot testing
Comments suppressed due to low confidence (1)

pyfixest/report/summarize.py:20

  • The docstring mentions a removed parameter 'show_se_type' in the function signature at line 105, but this parameter has been removed from the actual function signature. The docstring should be updated to remove references to this parameter.
def etable(

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

result = gelbach_decomposition.etable(type="df", digits=3)
assert result.to_string() == snapshot


Copy link

Copilot AI Dec 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove trailing whitespace from line 507.

Suggested change

Copilot uses AI. Check for mistakes.
result = pf.dtable(sample_df, vars=["var1"], type="df")

# Creating the expected DataFrame
# Note: maketables formats count as "5.00" instead of "5"
Copy link

Copilot AI Dec 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This explanatory comment appears before a change that updates expected values. Consider moving this comment closer to the actual change or removing it if it's now clear from context.

Suggested change
# Note: maketables formats count as "5.00" instead of "5"

Copilot uses AI. Check for mistakes.

::: {.callout-warning}
## Deprecation Notice
`pf.dtable()` will be deprecated in the future. Please use from the `maketables` package.
Copy link

Copilot AI Dec 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incomplete sentence - missing the function name after 'Please use'. Should be 'Please use DTable() from the maketables package.'

Suggested change
`pf.dtable()` will be deprecated in the future. Please use from the `maketables` package.
`pf.dtable()` will be deprecated in the future. Please use `DTable()` from the `maketables` package.

Copilot uses AI. Check for mistakes.
snapshot-test:
name: "Snapshot Tests"
runs-on: macos-14 # ARM-based macOS
continue-on-error: true # Warn only - does not block merge
Copy link

Copilot AI Dec 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Snapshot tests that don't block merges may allow visual regressions to slip through. Consider making these blocking once stabilized.

Suggested change
continue-on-error: true # Warn only - does not block merge
continue-on-error: ${{ github.event_name == 'schedule' }} # Allow failures on scheduled runs; block merges on push/PR

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants