1
1
"""
2
2
Package for SQL analytic functions wrappers
3
3
"""
4
+
4
5
from pypika .terms import AnalyticFunction , IgnoreNullsAnalyticFunction , WindowFrameAnalyticFunction
5
6
6
7
@@ -16,100 +17,100 @@ class Following(WindowFrameAnalyticFunction.Edge):
16
17
17
18
18
19
class Rank (AnalyticFunction ):
19
- def __init__ (self , ** kwargs ):
20
- super (Rank , self ).__init__ ("RANK" , ** kwargs )
20
+ def __init__ (self , ** kwargs ) -> None :
21
+ super ().__init__ ("RANK" , ** kwargs )
21
22
22
23
23
24
class DenseRank (AnalyticFunction ):
24
- def __init__ (self , ** kwargs ):
25
- super (DenseRank , self ).__init__ ("DENSE_RANK" , ** kwargs )
25
+ def __init__ (self , ** kwargs ) -> None :
26
+ super ().__init__ ("DENSE_RANK" , ** kwargs )
26
27
27
28
28
29
class RowNumber (AnalyticFunction ):
29
- def __init__ (self , ** kwargs ):
30
- super (RowNumber , self ).__init__ ("ROW_NUMBER" , ** kwargs )
30
+ def __init__ (self , ** kwargs ) -> None :
31
+ super ().__init__ ("ROW_NUMBER" , ** kwargs )
31
32
32
33
33
34
class NTile (AnalyticFunction ):
34
- def __init__ (self , term , ** kwargs ):
35
- super (NTile , self ).__init__ ("NTILE" , term , ** kwargs )
35
+ def __init__ (self , term , ** kwargs ) -> None :
36
+ super ().__init__ ("NTILE" , term , ** kwargs )
36
37
37
38
38
39
class FirstValue (WindowFrameAnalyticFunction , IgnoreNullsAnalyticFunction ):
39
- def __init__ (self , * terms , ** kwargs ):
40
- super (FirstValue , self ).__init__ ("FIRST_VALUE" , * terms , ** kwargs )
40
+ def __init__ (self , * terms , ** kwargs ) -> None :
41
+ super ().__init__ ("FIRST_VALUE" , * terms , ** kwargs )
41
42
42
43
43
44
class LastValue (WindowFrameAnalyticFunction , IgnoreNullsAnalyticFunction ):
44
- def __init__ (self , * terms , ** kwargs ):
45
- super (LastValue , self ).__init__ ("LAST_VALUE" , * terms , ** kwargs )
45
+ def __init__ (self , * terms , ** kwargs ) -> None :
46
+ super ().__init__ ("LAST_VALUE" , * terms , ** kwargs )
46
47
47
48
48
49
class Median (AnalyticFunction ):
49
- def __init__ (self , term , ** kwargs ):
50
- super (Median , self ).__init__ ("MEDIAN" , term , ** kwargs )
50
+ def __init__ (self , term , ** kwargs ) -> None :
51
+ super ().__init__ ("MEDIAN" , term , ** kwargs )
51
52
52
53
53
54
class Avg (WindowFrameAnalyticFunction ):
54
- def __init__ (self , term , ** kwargs ):
55
- super (Avg , self ).__init__ ("AVG" , term , ** kwargs )
55
+ def __init__ (self , term , ** kwargs ) -> None :
56
+ super ().__init__ ("AVG" , term , ** kwargs )
56
57
57
58
58
59
class StdDev (WindowFrameAnalyticFunction ):
59
- def __init__ (self , term , ** kwargs ):
60
- super (StdDev , self ).__init__ ("STDDEV" , term , ** kwargs )
60
+ def __init__ (self , term , ** kwargs ) -> None :
61
+ super ().__init__ ("STDDEV" , term , ** kwargs )
61
62
62
63
63
64
class StdDevPop (WindowFrameAnalyticFunction ):
64
- def __init__ (self , term , ** kwargs ):
65
- super (StdDevPop , self ).__init__ ("STDDEV_POP" , term , ** kwargs )
65
+ def __init__ (self , term , ** kwargs ) -> None :
66
+ super ().__init__ ("STDDEV_POP" , term , ** kwargs )
66
67
67
68
68
69
class StdDevSamp (WindowFrameAnalyticFunction ):
69
- def __init__ (self , term , ** kwargs ):
70
- super (StdDevSamp , self ).__init__ ("STDDEV_SAMP" , term , ** kwargs )
70
+ def __init__ (self , term , ** kwargs ) -> None :
71
+ super ().__init__ ("STDDEV_SAMP" , term , ** kwargs )
71
72
72
73
73
74
class Variance (WindowFrameAnalyticFunction ):
74
- def __init__ (self , term , ** kwargs ):
75
- super (Variance , self ).__init__ ("VARIANCE" , term , ** kwargs )
75
+ def __init__ (self , term , ** kwargs ) -> None :
76
+ super ().__init__ ("VARIANCE" , term , ** kwargs )
76
77
77
78
78
79
class VarPop (WindowFrameAnalyticFunction ):
79
- def __init__ (self , term , ** kwargs ):
80
- super (VarPop , self ).__init__ ("VAR_POP" , term , ** kwargs )
80
+ def __init__ (self , term , ** kwargs ) -> None :
81
+ super ().__init__ ("VAR_POP" , term , ** kwargs )
81
82
82
83
83
84
class VarSamp (WindowFrameAnalyticFunction ):
84
- def __init__ (self , term , ** kwargs ):
85
- super (VarSamp , self ).__init__ ("VAR_SAMP" , term , ** kwargs )
85
+ def __init__ (self , term , ** kwargs ) -> None :
86
+ super ().__init__ ("VAR_SAMP" , term , ** kwargs )
86
87
87
88
88
89
class Count (WindowFrameAnalyticFunction ):
89
- def __init__ (self , term , ** kwargs ):
90
- super (Count , self ).__init__ ("COUNT" , term , ** kwargs )
90
+ def __init__ (self , term , ** kwargs ) -> None :
91
+ super ().__init__ ("COUNT" , term , ** kwargs )
91
92
92
93
93
94
class Sum (WindowFrameAnalyticFunction ):
94
- def __init__ (self , term , ** kwargs ):
95
- super (Sum , self ).__init__ ("SUM" , term , ** kwargs )
95
+ def __init__ (self , term , ** kwargs ) -> None :
96
+ super ().__init__ ("SUM" , term , ** kwargs )
96
97
97
98
98
99
class Max (WindowFrameAnalyticFunction ):
99
- def __init__ (self , term , ** kwargs ):
100
- super (Max , self ).__init__ ("MAX" , term , ** kwargs )
100
+ def __init__ (self , term , ** kwargs ) -> None :
101
+ super ().__init__ ("MAX" , term , ** kwargs )
101
102
102
103
103
104
class Min (WindowFrameAnalyticFunction ):
104
- def __init__ (self , term , ** kwargs ):
105
- super (Min , self ).__init__ ("MIN" , term , ** kwargs )
105
+ def __init__ (self , term , ** kwargs ) -> None :
106
+ super ().__init__ ("MIN" , term , ** kwargs )
106
107
107
108
108
109
class Lag (AnalyticFunction ):
109
- def __init__ (self , * args , ** kwargs ):
110
- super (Lag , self ).__init__ ("LAG" , * args , ** kwargs )
110
+ def __init__ (self , * args , ** kwargs ) -> None :
111
+ super ().__init__ ("LAG" , * args , ** kwargs )
111
112
112
113
113
114
class Lead (AnalyticFunction ):
114
- def __init__ (self , * args , ** kwargs ):
115
- super (Lead , self ).__init__ ("LEAD" , * args , ** kwargs )
115
+ def __init__ (self , * args , ** kwargs ) -> None :
116
+ super ().__init__ ("LEAD" , * args , ** kwargs )
0 commit comments