ENH: snapshot testing of dataframes
See original GitHub issueIs your feature request related to a problem?
When testing dataframe manipulating functions defining explicit expected dataframes takes a lot of time.
Describe the solution you’d like
I’ve used snapshottest to test GraphQl APIs. The same approach could be implemented in a pytest plugin for pandas as well.
API breaking implications
[this should provide a description of how this feature will affect the API]
Describe alternatives you’ve considered
[this should provide a description of any alternative solutions or features you’ve considered]
Additional context
[add any other context, code examples, or references to existing implementations about the feature request here]
# Your code here, if applicable
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Snapshot Testing - Jest
Snapshot tests are a very useful tool whenever you want to make sure your UI does not change unexpectedly.
Read more >Snapshot tests - testthat
The goal of a unit test is to record the expected output of a function using code. This is a powerful technique because...
Read more >How do you Unit Test Python DataFrames - Stack Overflow
One technique you can use is to define one set of test data for a number of functions. That way, you can use...
Read more >Parse huge json file
The following is an example JSON object used in this test: JSON Object. ... using both the Dataframe and Spark SQL. json"); }...
Read more >Plotly button click - Topsh.it
I tried to replicate the code provided for testing the button click event for ... names it 'Snapshot', and re-directs its click event...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It’s worth noting that this works pretty well with
pytest
andsnapshottest
for a dataframe:@clintmod Yepp. The problem is that
.csv
does not save the df meta data (types of rows/columns, etc.) and that multi rows/columnns are tricky. Instead I usually store the data into.h5
instead. In any case you have to work with files which are not easy to read and diff. But right now I’m totally fine with implementing it this way.