File tree Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -8,5 +8,6 @@ dependencies:
8
8
- pip
9
9
- pre-commit
10
10
- pytest
11
+ - black
11
12
- pip :
12
13
- lazy-loader
Original file line number Diff line number Diff line change
1
+ """Tests for pandas series and dataframe method registration."""
2
+ import pandas_flavor as pf
3
+ import pandas as pd
4
+
5
+
6
+ def test_register_dataframe_method ():
7
+ """Test register_dataframe_method."""
8
+
9
+ @pf .register_dataframe_method
10
+ def dummy_func (df : pd .DataFrame ) -> pd .DataFrame :
11
+ """Dummy function.
12
+
13
+ Args:
14
+ df: a pandas DataFrame
15
+
16
+ Returns:
17
+ df: A pandas DataFrame.
18
+ """
19
+ return df
20
+
21
+ df = pd .DataFrame ()
22
+ df .dummy_func ()
23
+
24
+
25
+ def test_register_series_method ():
26
+ """Test register_series_method."""
27
+
28
+ @pf .register_series_method
29
+ def dummy_func (s : pd .Series ) -> pd .Series :
30
+ """Dummy func.
31
+
32
+ Args:
33
+ s: A pandas Series.
34
+
35
+ Returns:
36
+ s: A pandas Series.
37
+ """
38
+ return s
39
+
40
+ ser = pd .Series ()
41
+ ser .dummy_func ()
You can’t perform that action at this time.
0 commit comments