Skip to content

Commit

Permalink
[ENH] improve performance for polars' complete (#1389)
Browse files Browse the repository at this point in the history
* remove ambiguity with structs

* fix docs

* pin numpy

* fix docs

* fix docs

* add polars.expand

* add polars.expand

* add tests polars expand

* pin setuptools

* fix docs

* fix docs

* add extra test for polars expand

* remove assumptions when fill_value is a dict

* add test for pl.Series

* fix column selection logic

---------

Co-authored-by: samuel.oranyeli <[email protected]>
Co-authored-by: Eric Ma <[email protected]>
  • Loading branch information
3 people authored Jul 31, 2024
1 parent a14061c commit 633c891
Show file tree
Hide file tree
Showing 6 changed files with 421 additions and 88 deletions.
4 changes: 3 additions & 1 deletion environment-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ dependencies:
- mypy
- natsort
- numba
- numpy
- numpy==1.24.4
- openpyxl
- pandas-flavor
- pandas-vet
Expand All @@ -51,3 +51,5 @@ dependencies:
- xorg-libxrender
- pip:
- mknotebooks
# Temporarily pinned to fix CI
- setuptools==70.3.0
1 change: 0 additions & 1 deletion janitor/functions/convert_date.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ def convert_matlab_date(
return df.assign(**dictionary)


@pf.register_dataframe_method
@pf.register_dataframe_method
@refactored_function(
message=(
Expand Down
3 changes: 2 additions & 1 deletion janitor/polars/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from .clean_names import clean_names, make_clean_names
from .complete import complete
from .complete import complete, expand
from .dates_to_polars import convert_excel_date, convert_matlab_date
from .pivot_longer import pivot_longer, pivot_longer_spec
from .row_to_names import row_to_names
Expand All @@ -10,6 +10,7 @@
"clean_names",
"make_clean_names",
"row_to_names",
"expand",
"complete",
"convert_excel_date",
"convert_matlab_date",
Expand Down
Loading

0 comments on commit 633c891

Please sign in to comment.