Skip to content

Commit a5df69e

Browse files
committed
more refactoring
1 parent c06e2d9 commit a5df69e

File tree

1 file changed

+41
-41
lines changed

1 file changed

+41
-41
lines changed

modin/core/storage_formats/pandas/query_compiler.py

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1412,7 +1412,7 @@ def expanding_corr(
14121412

14131413
old_window_mean = Fold.register(
14141414
lambda df, rolling_kwargs, *args, **kwargs: pandas.DataFrame(
1415-
df.rolling(*rolling_kwargs).mean(*args, **kwargs)
1415+
df.rolling(**rolling_kwargs).mean(*args, **kwargs)
14161416
)
14171417
)
14181418

@@ -1425,15 +1425,15 @@ def window_mean(self, axis, window_kwargs, *args, **kwargs):
14251425
self._modin_frame.window(
14261426
axis,
14271427
window,
1428-
lambda df: df.rolling(*window_kwargs).mean(*args, **kwargs),
1428+
lambda df: df.rolling(**window_kwargs).mean(*args, **kwargs),
14291429
)
14301430
)
14311431
else:
14321432
return self.old_window_mean(axis, window_kwargs, *args, **kwargs)
14331433

14341434
old_window_sum = Fold.register(
14351435
lambda df, rolling_kwargs, *args, **kwargs: pandas.DataFrame(
1436-
df.rolling(*rolling_kwargs).sum(*args, **kwargs)
1436+
df.rolling(**rolling_kwargs).sum(*args, **kwargs)
14371437
)
14381438
)
14391439

@@ -1446,15 +1446,15 @@ def window_sum(self, axis, window_kwargs, *args, **kwargs):
14461446
self._modin_frame.window(
14471447
axis,
14481448
window,
1449-
lambda df: df.rolling(*window_kwargs).sum(*args, **kwargs),
1449+
lambda df: df.rolling(**window_kwargs).sum(*args, **kwargs),
14501450
)
14511451
)
14521452
else:
14531453
return self.old_window_sum(axis, window_kwargs, *args, **kwargs)
14541454

14551455
old_window_var = Fold.register(
14561456
lambda df, rolling_kwargs, ddof, *args, **kwargs: pandas.DataFrame(
1457-
df.rolling(*rolling_kwargs).var(ddof=ddof, *args, **kwargs)
1457+
df.rolling(**rolling_kwargs).var(ddof=ddof, *args, **kwargs)
14581458
)
14591459
)
14601460

@@ -1467,15 +1467,15 @@ def window_var(self, axis, window_kwargs, ddof, *args, **kwargs):
14671467
self._modin_frame.window(
14681468
axis,
14691469
window,
1470-
lambda df: df.rolling(*window_kwargs).var(ddof, *args, **kwargs),
1470+
lambda df: df.rolling(**window_kwargs).var(ddof, *args, **kwargs),
14711471
)
14721472
)
14731473
else:
14741474
return self.old_window_var(axis, window_kwargs, ddof, *args, **kwargs)
14751475

14761476
old_window_std = Fold.register(
14771477
lambda df, rolling_kwargs, ddof, *args, **kwargs: pandas.DataFrame(
1478-
df.rolling(*rolling_kwargs).std(ddof=ddof, *args, **kwargs)
1478+
df.rolling(**rolling_kwargs).std(ddof=ddof, *args, **kwargs)
14791479
)
14801480
)
14811481

@@ -1488,14 +1488,14 @@ def window_std(self, axis, window_kwargs, ddof, *args, **kwargs):
14881488
self._modin_frame.window(
14891489
axis,
14901490
window,
1491-
lambda df: df.rolling(*window_kwargs).std(ddof=ddof, *args, **kwargs),
1491+
lambda df: df.rolling(**window_kwargs).std(ddof=ddof, *args, **kwargs),
14921492
)
14931493
)
14941494
else:
14951495
return self.old_window_std(axis, window_kwargs, ddof, *args, **kwargs)
14961496

14971497
old_rolling_count = Fold.register(
1498-
lambda df, rolling_kwargs: pandas.DataFrame(df.rolling(*rolling_kwargs).count())
1498+
lambda df, rolling_kwargs: pandas.DataFrame(df.rolling(**rolling_kwargs).count())
14991499
)
15001500

15011501
def rolling_count(self, axis, rolling_kwargs):
@@ -1505,15 +1505,15 @@ def rolling_count(self, axis, rolling_kwargs):
15051505
if _can_use_cell_wise_window(center, window, win_type):
15061506
return self.__constructor__(
15071507
self._modin_frame.window(
1508-
axis, window, lambda df: df.rolling(*rolling_kwargs).count()
1508+
axis, window, lambda df: df.rolling(**rolling_kwargs).count()
15091509
)
15101510
)
15111511
else:
15121512
return self.old_rolling_count(axis, rolling_kwargs)
15131513

15141514
old_rolling_sum = Fold.register(
15151515
lambda df, rolling_kwargs, *args, **kwargs: pandas.DataFrame(
1516-
df.rolling(*rolling_kwargs).sum(*args, **kwargs)
1516+
df.rolling(**rolling_kwargs).sum(*args, **kwargs)
15171517
)
15181518
)
15191519

@@ -1526,15 +1526,15 @@ def rolling_sum(self, axis, rolling_kwargs, *args, **kwargs):
15261526
self._modin_frame.window(
15271527
axis,
15281528
window,
1529-
lambda df: df.rolling(*rolling_kwargs).sum(*args, **kwargs),
1529+
lambda df: df.rolling(**rolling_kwargs).sum(*args, **kwargs),
15301530
)
15311531
)
15321532
else:
15331533
return self.old_rolling_sum(axis, rolling_kwargs, *args, **kwargs)
15341534

15351535
old_rolling_sem = Fold.register(
15361536
lambda df, rolling_kwargs, *args, **kwargs: pandas.DataFrame(
1537-
df.rolling(*rolling_kwargs).sem(*args, **kwargs)
1537+
df.rolling(**rolling_kwargs).sem(*args, **kwargs)
15381538
)
15391539
)
15401540

@@ -1547,15 +1547,15 @@ def rolling_sem(self, axis, rolling_kwargs, *args, **kwargs):
15471547
self._modin_frame.window(
15481548
axis,
15491549
window,
1550-
lambda df: df.rolling(*rolling_kwargs).sem(*args, **kwargs),
1550+
lambda df: df.rolling(**rolling_kwargs).sem(*args, **kwargs),
15511551
)
15521552
)
15531553
else:
15541554
return self.old_rolling_sem(axis, rolling_kwargs, *args, **kwargs)
15551555

15561556
old_rolling_mean = Fold.register(
15571557
lambda df, rolling_kwargs, *args, **kwargs: pandas.DataFrame(
1558-
df.rolling(*rolling_kwargs).mean(*args, **kwargs)
1558+
df.rolling(**rolling_kwargs).mean(*args, **kwargs)
15591559
)
15601560
)
15611561

@@ -1568,15 +1568,15 @@ def rolling_mean(self, axis, rolling_kwargs, *args, **kwargs):
15681568
self._modin_frame.window(
15691569
axis,
15701570
window,
1571-
lambda df: df.rolling(*rolling_kwargs).mean(*args, **kwargs),
1571+
lambda df: df.rolling(**rolling_kwargs).mean(*args, **kwargs),
15721572
)
15731573
)
15741574
else:
15751575
return self.old_rolling_mean(axis, rolling_kwargs, *args, **kwargs)
15761576

15771577
old_rolling_median = Fold.register(
15781578
lambda df, rolling_kwargs, **kwargs: pandas.DataFrame(
1579-
df.rolling(*rolling_kwargs).median(**kwargs)
1579+
df.rolling(**rolling_kwargs).median(**kwargs)
15801580
)
15811581
)
15821582

@@ -1587,15 +1587,15 @@ def rolling_median(self, axis, rolling_kwargs, **kwargs):
15871587
if _can_use_cell_wise_window(center, window, win_type):
15881588
return self.__constructor__(
15891589
self._modin_frame.window(
1590-
axis, window, lambda df: df.rolling(*rolling_kwargs).median(**kwargs)
1590+
axis, window, lambda df: df.rolling(**rolling_kwargs).median(**kwargs)
15911591
)
15921592
)
15931593
else:
15941594
return self.old_rolling_median(axis, rolling_kwargs, **kwargs)
15951595

15961596
old_rolling_var = Fold.register(
15971597
lambda df, rolling_kwargs, ddof, *args, **kwargs: pandas.DataFrame(
1598-
df.rolling(*rolling_kwargs).var(ddof=ddof, *args, **kwargs)
1598+
df.rolling(**rolling_kwargs).var(ddof=ddof, *args, **kwargs)
15991599
)
16001600
)
16011601

@@ -1608,7 +1608,7 @@ def rolling_var(self, axis, rolling_kwargs, ddof, *args, **kwargs):
16081608
self._modin_frame.window(
16091609
axis,
16101610
window,
1611-
lambda df: df.rolling(*rolling_kwargs).var(
1611+
lambda df: df.rolling(**rolling_kwargs).var(
16121612
ddof=ddof, *args, **kwargs
16131613
),
16141614
)
@@ -1618,7 +1618,7 @@ def rolling_var(self, axis, rolling_kwargs, ddof, *args, **kwargs):
16181618

16191619
old_rolling_std = Fold.register(
16201620
lambda df, rolling_kwargs, ddof, *args, **kwargs: pandas.DataFrame(
1621-
df.rolling(*rolling_kwargs).std(ddof=ddof, *args, **kwargs)
1621+
df.rolling(**rolling_kwargs).std(ddof=ddof, *args, **kwargs)
16221622
)
16231623
)
16241624

@@ -1631,7 +1631,7 @@ def rolling_std(self, axis, rolling_kwargs, ddof, *args, **kwargs):
16311631
self._modin_frame.window(
16321632
axis,
16331633
window,
1634-
lambda df: df.rolling(*rolling_kwargs).std(
1634+
lambda df: df.rolling(**rolling_kwargs).std(
16351635
ddof=ddof, *args, **kwargs
16361636
),
16371637
)
@@ -1641,7 +1641,7 @@ def rolling_std(self, axis, rolling_kwargs, ddof, *args, **kwargs):
16411641

16421642
old_rolling_min = Fold.register(
16431643
lambda df, rolling_kwargs, *args, **kwargs: pandas.DataFrame(
1644-
df.rolling(*rolling_kwargs).min(*args, **kwargs)
1644+
df.rolling(**rolling_kwargs).min(*args, **kwargs)
16451645
)
16461646
)
16471647

@@ -1654,15 +1654,15 @@ def rolling_min(self, axis, rolling_kwargs, *args, **kwargs):
16541654
self._modin_frame.window(
16551655
axis,
16561656
window,
1657-
lambda df: df.rolling(*rolling_kwargs).min(*args, **kwargs),
1657+
lambda df: df.rolling(**rolling_kwargs).min(*args, **kwargs),
16581658
)
16591659
)
16601660
else:
16611661
return self.old_rolling_min(axis, rolling_kwargs, *args, **kwargs)
16621662

16631663
old_rolling_max = Fold.register(
16641664
lambda df, rolling_kwargs, *args, **kwargs: pandas.DataFrame(
1665-
df.rolling(*rolling_kwargs).max(*args, **kwargs)
1665+
df.rolling(**rolling_kwargs).max(*args, **kwargs)
16661666
)
16671667
)
16681668

@@ -1675,15 +1675,15 @@ def rolling_max(self, axis, rolling_kwargs, *args, **kwargs):
16751675
self._modin_frame.window(
16761676
axis,
16771677
window,
1678-
lambda df: df.rolling(*rolling_kwargs).max(*args, **kwargs),
1678+
lambda df: df.rolling(**rolling_kwargs).max(*args, **kwargs),
16791679
)
16801680
)
16811681
else:
16821682
return self.old_rolling_max(axis, rolling_kwargs, *args, **kwargs)
16831683

16841684
old_rolling_skew = Fold.register(
16851685
lambda df, rolling_kwargs, **kwargs: pandas.DataFrame(
1686-
df.rolling(*rolling_kwargs).skew(**kwargs)
1686+
df.rolling(**rolling_kwargs).skew(**kwargs)
16871687
)
16881688
)
16891689

@@ -1694,15 +1694,15 @@ def rolling_skew(self, axis, rolling_kwargs, **kwargs):
16941694
if _can_use_cell_wise_window(center, window, win_type):
16951695
return self.__constructor__(
16961696
self._modin_frame.window(
1697-
axis, window, lambda df: df.rolling(*rolling_kwargs).skew(**kwargs)
1697+
axis, window, lambda df: df.rolling(**rolling_kwargs).skew(**kwargs)
16981698
)
16991699
)
17001700
else:
17011701
return self.old_rolling_skew(axis, rolling_kwargs, **kwargs)
17021702

17031703
old_rolling_kurt = Fold.register(
17041704
lambda df, rolling_kwargs, **kwargs: pandas.DataFrame(
1705-
df.rolling(*rolling_kwargs).kurt(**kwargs)
1705+
df.rolling(**rolling_kwargs).kurt(**kwargs)
17061706
)
17071707
)
17081708

@@ -1713,15 +1713,15 @@ def rolling_kurt(self, axis, rolling_kwargs, **kwargs):
17131713
if _can_use_cell_wise_window(center, window, win_type):
17141714
return self.__constructor__(
17151715
self._modin_frame.window(
1716-
axis, window, lambda df: df.rolling(*rolling_kwargs).kurt(**kwargs)
1716+
axis, window, lambda df: df.rolling(**rolling_kwargs).kurt(**kwargs)
17171717
)
17181718
)
17191719
else:
17201720
return self.old_rolling_kurt(axis, rolling_kwargs, **kwargs)
17211721

17221722
old_rolling_apply = Fold.register(
17231723
lambda df, rolling_kwargs, func, raw, engine, engine_kwargs, args, kwargs: pandas.DataFrame(
1724-
df.rolling(*rolling_kwargs).apply(
1724+
df.rolling(**rolling_kwargs).apply(
17251725
func=func,
17261726
raw=raw,
17271727
engine=engine,
@@ -1743,7 +1743,7 @@ def rolling_apply(
17431743
self._modin_frame.window(
17441744
axis,
17451745
window,
1746-
lambda df: df.rolling(*rolling_kwargs).apply(
1746+
lambda df: df.rolling(**rolling_kwargs).apply(
17471747
func=func,
17481748
raw=raw,
17491749
engine=engine,
@@ -1767,7 +1767,7 @@ def rolling_apply(
17671767

17681768
old_rolling_rank = Fold.register(
17691769
lambda df, rolling_kwargs, method, ascending, pct, numeric_only, **kwargs: pandas.DataFrame(
1770-
df.rolling(*rolling_kwargs).rank(
1770+
df.rolling(**rolling_kwargs).rank(
17711771
method=method,
17721772
ascending=ascending,
17731773
pct=pct,
@@ -1788,7 +1788,7 @@ def rolling_rank(
17881788
self._modin_frame.window(
17891789
axis,
17901790
window,
1791-
lambda df: df.rolling(*rolling_kwargs).rank(
1791+
lambda df: df.rolling(**rolling_kwargs).rank(
17921792
method=method,
17931793
ascending=ascending,
17941794
pct=pct,
@@ -1804,7 +1804,7 @@ def rolling_rank(
18041804

18051805
old_rolling_quantile = Fold.register(
18061806
lambda df, rolling_kwargs, quantile, interpolation, **kwargs: pandas.DataFrame(
1807-
df.rolling(*rolling_kwargs).quantile(
1807+
df.rolling(**rolling_kwargs).quantile(
18081808
quantile=quantile, interpolation=interpolation, **kwargs
18091809
)
18101810
)
@@ -1819,7 +1819,7 @@ def rolling_quantile(self, axis, rolling_kwargs, quantile, interpolation, **kwar
18191819
self._modin_frame.window(
18201820
axis,
18211821
window,
1822-
lambda df: df.rolling(*rolling_kwargs).quantile(
1822+
lambda df: df.rolling(**rolling_kwargs).quantile(
18231823
quantile=quantile, interpolation=interpolation, **kwargs
18241824
),
18251825
)
@@ -1831,7 +1831,7 @@ def rolling_quantile(self, axis, rolling_kwargs, quantile, interpolation, **kwar
18311831

18321832
old_rolling_corr = Fold.register(
18331833
lambda df, rolling_kwargs, other, pairwise, *args, **kwargs: pandas.DataFrame(
1834-
df.rolling(*rolling_kwargs).corr(
1834+
df.rolling(**rolling_kwargs).corr(
18351835
other=other, pairwise=pairwise, *args, **kwargs
18361836
)
18371837
)
@@ -1853,7 +1853,7 @@ def rolling_corr(self, axis, rolling_kwargs, other, pairwise, *args, **kwargs):
18531853
self._modin_frame.window(
18541854
axis,
18551855
window,
1856-
lambda df: df.rolling(*rolling_kwargs).corr(
1856+
lambda df: df.rolling(**rolling_kwargs).corr(
18571857
other=other, pairwise=pairwise, *args, **kwargs
18581858
),
18591859
)
@@ -1865,7 +1865,7 @@ def rolling_corr(self, axis, rolling_kwargs, other, pairwise, *args, **kwargs):
18651865

18661866
old_rolling_cov = Fold.register(
18671867
lambda df, rolling_kwargs, other, pairwise, ddof, **kwargs: pandas.DataFrame(
1868-
df.rolling(*rolling_kwargs).cov(
1868+
df.rolling(**rolling_kwargs).cov(
18691869
other=other, pairwise=pairwise, ddof=ddof, **kwargs
18701870
)
18711871
)
@@ -1891,7 +1891,7 @@ def rolling_cov(self, axis, rolling_kwargs, other, pairwise, ddof, **kwargs):
18911891
self._modin_frame.window(
18921892
axis,
18931893
window,
1894-
lambda df: df.rolling(*rolling_kwargs).cov(
1894+
lambda df: df.rolling(**rolling_kwargs).cov(
18951895
other=other, pairwise=pairwise, **kwargs
18961896
),
18971897
)
@@ -1907,7 +1907,7 @@ def rolling_aggregate(self, axis, rolling_kwargs, func, *args, **kwargs):
19071907
new_modin_frame = self._modin_frame.apply_full_axis(
19081908
axis,
19091909
lambda df: pandas.DataFrame(
1910-
df.rolling(*rolling_kwargs).aggregate(func=func, *args, **kwargs)
1910+
df.rolling(**rolling_kwargs).aggregate(func=func, *args, **kwargs)
19111911
),
19121912
new_index=self.index,
19131913
)

0 commit comments

Comments
 (0)