1
- """An exhaustive list of pandas methods exercising NDFrame.__finalize__.
2
- """
1
+ """An exhaustive list of pandas methods exercising NDFrame.__finalize__."""
3
2
4
3
import operator
5
4
import re
6
5
7
6
import numpy as np
8
7
import pytest
9
8
10
- import pandas as pd
11
9
from pandas ._typing import MergeHow
12
10
11
+ import pandas as pd
12
+
13
13
# TODO:
14
14
# * Binary methods (mul, div, etc.)
15
15
# * Binary outputs (align, etc.)
@@ -577,7 +577,8 @@ def test_datetime_property(attr):
577
577
578
578
579
579
@pytest .mark .parametrize (
580
- "attr" , ["days" , "seconds" , "microseconds" , "nanoseconds" , "components" ],
580
+ "attr" ,
581
+ ["days" , "seconds" , "microseconds" , "nanoseconds" , "components" ],
581
582
)
582
583
def test_timedelta_property (attr ):
583
584
s = pd .Series (pd .timedelta_range ("2000" , periods = 4 ))
@@ -621,7 +622,8 @@ def test_categorical_accessor(method):
621
622
622
623
623
624
@pytest .mark .parametrize (
624
- "obj" , [pd .Series ([0 , 0 ]), pd .DataFrame ({"A" : [0 , 1 ], "B" : [1 , 2 ]})],
625
+ "obj" ,
626
+ [pd .Series ([0 , 0 ]), pd .DataFrame ({"A" : [0 , 1 ], "B" : [1 , 2 ]})],
625
627
)
626
628
@pytest .mark .parametrize (
627
629
"method" ,
@@ -640,7 +642,8 @@ def test_groupby_finalize(obj, method):
640
642
641
643
642
644
@pytest .mark .parametrize (
643
- "obj" , [pd .Series ([0 , 0 ]), pd .DataFrame ({"A" : [0 , 1 ], "B" : [1 , 2 ]})],
645
+ "obj" ,
646
+ [pd .Series ([0 , 0 ]), pd .DataFrame ({"A" : [0 , 1 ], "B" : [1 , 2 ]})],
644
647
)
645
648
@pytest .mark .parametrize (
646
649
"method" ,
@@ -689,7 +692,9 @@ def test_finalize_frame_series_name():
689
692
],
690
693
)
691
694
def test_merge_sets_duplication_allowance_flag (
692
- how : MergeHow , allow_on_left : bool , allow_on_right : bool ,
695
+ how : MergeHow ,
696
+ allow_on_left : bool ,
697
+ allow_on_right : bool ,
693
698
):
694
699
"""Check that DataFrame.merge correctly sets the allow_duplicate_labels flag
695
700
on its result.
@@ -719,7 +724,8 @@ def test_merge_sets_duplication_allowance_flag(
719
724
[(False , False ), (False , True ), (True , False ), (True , True )],
720
725
)
721
726
def test_merge_asof_sets_duplication_allowance_flag (
722
- allow_on_left : bool , allow_on_right : bool ,
727
+ allow_on_left : bool ,
728
+ allow_on_right : bool ,
723
729
):
724
730
"""Check that pandas.merge_asof correctly sets the allow_duplicate_labels flag
725
731
on its result.
@@ -794,7 +800,9 @@ def test_merge_does_not_propagate_metadata_from_unequal_input_metadata():
794
800
ids = ["left-empty" , "right-empty" , "both-empty" ],
795
801
)
796
802
def test_merge_does_not_propagate_metadata_if_one_input_has_no_metadata (
797
- left : pd .DataFrame , right : pd .DataFrame , expected : dict ,
803
+ left : pd .DataFrame ,
804
+ right : pd .DataFrame ,
805
+ expected : dict ,
798
806
):
799
807
"""Check that if the metadata for one input to pandas.merge is empty, the result
800
808
of merge has the same metadata as the other input.
0 commit comments