Note that this PR includes SQL support for pivot_wider and pivot_longer
TODO:
[x] : review tidyr unit tests for pivot_longer
[x] : draft pivot_wider with basic tests
[ ] : add docstring for pivot_longer and pivot_wider, add to API docs will add to new docs site.
[ ] : double check the behavior of names_transform and values_transform (e.g. with multiple value cols) leaving in siuba.experimental. Want to circle back and double check, but pivot's scope is so big, and so many tests are passing, that it seems worth merging now.
Edit:
Additional changes:
fix: separate() and extract() can now correctly overwrite columns.
fix: expand() respects categoricals (and is better at preserving types).
feat: complete() now supports the explicit argument, which fills only implicit NAs when False.
feat: add pivot related datasets -- fish_encounters, us_rent_income, warpbreaks
tests: fixtures moved to siuba/tests/fixtures.py, loaded in siuba/tests/conftest.py using pytest_plugins variable. This was necessary to load fixtures for the pivot test suites, which live outside the siuba/tests directory.
ci: minimum tested pandas version bumped to v1.2.0, so siuba can us pd.merge(... , how = "cross")
TODO:
pivot_wider
with basic testsadd docstring forwill add to new docs site.pivot_longer
andpivot_wider
, add to API docsdouble check the behavior of names_transform and values_transform (e.g. with multiple value cols)leaving insiuba.experimental
. Want to circle back and double check, but pivot's scope is so big, and so many tests are passing, that it seems worth merging now.Edit:
Additional changes:
separate()
andextract()
can now correctly overwrite columns.expand()
respects categoricals (and is better at preserving types).complete()
now supports theexplicit
argument, which fills only implicit NAs when False.siuba/tests/fixtures.py
, loaded insiuba/tests/conftest.py
usingpytest_plugins
variable. This was necessary to load fixtures for the pivot test suites, which live outside thesiuba/tests
directory.pd.merge(... , how = "cross")