pylegend 0.2.2__py3-none-any.whl → 0.4.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pylegend/__init__.py +9 -5
- pylegend/core/{databse → database}/sql_to_string/__init__.py +3 -3
- pylegend/core/{databse → database}/sql_to_string/db_extension.py +11 -5
- pylegend/core/{databse → database}/sql_to_string/generator.py +2 -2
- pylegend/core/language/__init__.py +10 -10
- pylegend/core/language/legacy_api/__init__.py +13 -0
- pylegend/core/language/{aggregate_specification.py → legacy_api/aggregate_specification.py} +10 -10
- pylegend/core/language/legacy_api/legacy_api_tds_row.py +32 -0
- pylegend/core/language/legendql_api/__init__.py +13 -0
- pylegend/core/language/legendql_api/legendql_api_custom_expressions.py +541 -0
- pylegend/core/language/legendql_api/legendql_api_tds_row.py +292 -0
- pylegend/core/language/shared/__init__.py +13 -0
- pylegend/core/language/{column_expressions.py → shared/column_expressions.py} +32 -31
- pylegend/core/language/{expression.py → shared/expression.py} +8 -0
- pylegend/core/language/{functions.py → shared/functions.py} +3 -3
- pylegend/core/language/shared/helpers.py +75 -0
- pylegend/core/language/{literal_expressions.py → shared/literal_expressions.py} +39 -1
- pylegend/core/language/{operations → shared/operations}/binary_expression.py +34 -2
- pylegend/core/language/{operations → shared/operations}/boolean_operation_expressions.py +34 -6
- pylegend/core/language/{operations → shared/operations}/collection_operation_expressions.py +146 -26
- pylegend/core/language/{operations → shared/operations}/date_operation_expressions.py +164 -24
- pylegend/core/language/{operations → shared/operations}/float_operation_expressions.py +53 -8
- pylegend/core/language/{operations → shared/operations}/integer_operation_expressions.py +62 -9
- pylegend/core/language/{operations → shared/operations}/nullary_expression.py +9 -2
- pylegend/core/language/{operations → shared/operations}/number_operation_expressions.py +211 -30
- pylegend/core/language/{operations → shared/operations}/primitive_operation_expressions.py +42 -3
- pylegend/core/language/{operations → shared/operations}/string_operation_expressions.py +169 -21
- pylegend/core/language/{operations → shared/operations}/unary_expression.py +10 -2
- pylegend/core/language/{primitive_collection.py → shared/primitive_collection.py} +2 -2
- pylegend/core/language/{primitives → shared/primitives}/__init__.py +9 -9
- pylegend/core/language/{primitives → shared/primitives}/boolean.py +9 -5
- pylegend/core/language/{primitives → shared/primitives}/date.py +23 -15
- pylegend/core/language/{primitives → shared/primitives}/datetime.py +4 -5
- pylegend/core/language/{primitives → shared/primitives}/float.py +6 -6
- pylegend/core/language/{primitives → shared/primitives}/integer.py +6 -6
- pylegend/core/language/{primitives → shared/primitives}/number.py +16 -13
- pylegend/core/language/{primitives → shared/primitives}/primitive.py +25 -5
- pylegend/core/language/{primitives → shared/primitives}/strictdate.py +4 -5
- pylegend/core/language/{primitives → shared/primitives}/string.py +18 -19
- pylegend/core/language/{tds_row.py → shared/tds_row.py} +46 -16
- pylegend/core/request/__init__.py +8 -1
- pylegend/core/request/auth.py +89 -11
- pylegend/core/request/legend_client.py +32 -0
- pylegend/core/sql/metamodel_extension.py +16 -0
- pylegend/core/tds/abstract/__init__.py +13 -0
- pylegend/core/tds/abstract/frames/__init__.py +13 -0
- pylegend/core/tds/{legend_api/frames/legend_api_applied_function_tds_frame.py → abstract/frames/applied_function_tds_frame.py} +19 -13
- pylegend/core/tds/abstract/frames/base_tds_frame.py +125 -0
- pylegend/core/tds/{legend_api/frames/legend_api_input_tds_frame.py → abstract/frames/input_tds_frame.py} +9 -12
- pylegend/core/tds/{legend_api/frames/functions → abstract}/function_helpers.py +1 -1
- pylegend/core/tds/{legend_api/frames/functions/concatenate_function.py → legacy_api/frames/functions/legacy_api_concatenate_function.py} +25 -13
- pylegend/core/tds/{legend_api/frames/functions/distinct_function.py → legacy_api/frames/functions/legacy_api_distinct_function.py} +13 -8
- pylegend/core/tds/{legend_api/frames/functions/drop_function.py → legacy_api/frames/functions/legacy_api_drop_function.py} +13 -8
- pylegend/core/tds/{legend_api/frames/functions/extend_function.py → legacy_api/frames/functions/legacy_api_extend_function.py} +36 -16
- pylegend/core/tds/{legend_api/frames/functions/filter_function.py → legacy_api/frames/functions/legacy_api_filter_function.py} +25 -13
- pylegend/core/tds/{legend_api/frames/functions/group_by_function.py → legacy_api/frames/functions/legacy_api_group_by_function.py} +44 -17
- pylegend/core/tds/{legend_api/frames/functions/head_function.py → legacy_api/frames/functions/legacy_api_head_function.py} +13 -8
- pylegend/core/tds/{legend_api/frames/functions/join_by_columns_function.py → legacy_api/frames/functions/legacy_api_join_by_columns_function.py} +40 -13
- pylegend/core/tds/{legend_api/frames/functions/join_function.py → legacy_api/frames/functions/legacy_api_join_function.py} +44 -20
- pylegend/core/tds/{legend_api/frames/functions/rename_columns_function.py → legacy_api/frames/functions/legacy_api_rename_columns_function.py} +20 -8
- pylegend/core/tds/{legend_api/frames/functions/restrict_function.py → legacy_api/frames/functions/legacy_api_restrict_function.py} +17 -8
- pylegend/core/tds/{legend_api/frames/functions/slice_function.py → legacy_api/frames/functions/legacy_api_slice_function.py} +13 -8
- pylegend/core/tds/{legend_api/frames/functions/sort_function.py → legacy_api/frames/functions/legacy_api_sort_function.py} +19 -8
- pylegend/core/tds/legacy_api/frames/legacy_api_applied_function_tds_frame.py +37 -0
- pylegend/core/tds/legacy_api/frames/legacy_api_base_tds_frame.py +204 -0
- pylegend/core/tds/legacy_api/frames/legacy_api_input_tds_frame.py +51 -0
- pylegend/core/tds/{legend_api/frames/legend_api_tds_frame.py → legacy_api/frames/legacy_api_tds_frame.py} +28 -28
- pylegend/core/tds/legendql_api/__init__.py +13 -0
- pylegend/core/tds/legendql_api/frames/__init__.py +13 -0
- pylegend/core/tds/legendql_api/frames/functions/__init__.py +13 -0
- pylegend/core/tds/legendql_api/frames/functions/legendql_api_asofjoin_function.py +156 -0
- pylegend/core/tds/legendql_api/frames/functions/legendql_api_concatenate_function.py +139 -0
- pylegend/core/tds/legendql_api/frames/functions/legendql_api_distinct_function.py +69 -0
- pylegend/core/tds/legendql_api/frames/functions/legendql_api_drop_function.py +74 -0
- pylegend/core/tds/legendql_api/frames/functions/legendql_api_extend_function.py +256 -0
- pylegend/core/tds/legendql_api/frames/functions/legendql_api_filter_function.py +121 -0
- pylegend/core/tds/legendql_api/frames/functions/legendql_api_function_helpers.py +137 -0
- pylegend/core/tds/legendql_api/frames/functions/legendql_api_groupby_function.py +256 -0
- pylegend/core/tds/legendql_api/frames/functions/legendql_api_head_function.py +74 -0
- pylegend/core/tds/legendql_api/frames/functions/legendql_api_join_function.py +214 -0
- pylegend/core/tds/legendql_api/frames/functions/legendql_api_project_function.py +169 -0
- pylegend/core/tds/legendql_api/frames/functions/legendql_api_rename_function.py +189 -0
- pylegend/core/tds/legendql_api/frames/functions/legendql_api_select_function.py +131 -0
- pylegend/core/tds/legendql_api/frames/functions/legendql_api_slice_function.py +82 -0
- pylegend/core/tds/legendql_api/frames/functions/legendql_api_sort_function.py +93 -0
- pylegend/core/tds/legendql_api/frames/functions/legendql_api_window_extend_function.py +283 -0
- pylegend/core/tds/legendql_api/frames/legendql_api_applied_function_tds_frame.py +37 -0
- pylegend/core/tds/legendql_api/frames/legendql_api_base_tds_frame.py +419 -0
- pylegend/core/tds/legendql_api/frames/legendql_api_input_tds_frame.py +50 -0
- pylegend/core/tds/legendql_api/frames/legendql_api_tds_frame.py +327 -0
- pylegend/core/tds/pandas_api/frames/functions/assign_function.py +6 -6
- pylegend/core/tds/pandas_api/frames/pandas_api_applied_function_tds_frame.py +4 -0
- pylegend/core/tds/pandas_api/frames/pandas_api_base_tds_frame.py +11 -3
- pylegend/core/tds/pandas_api/frames/pandas_api_tds_frame.py +2 -2
- pylegend/core/tds/tds_frame.py +32 -2
- pylegend/extensions/database/vendors/postgres/postgres_sql_to_string.py +1 -1
- pylegend/extensions/tds/abstract/legend_function_input_frame.py +4 -0
- pylegend/extensions/tds/abstract/legend_service_input_frame.py +4 -0
- pylegend/extensions/tds/abstract/table_spec_input_frame.py +4 -0
- pylegend/extensions/tds/{legend_api/frames/legend_api_legend_function_input_frame.py → legacy_api/frames/legacy_api_legend_function_input_frame.py} +5 -5
- pylegend/extensions/tds/{legend_api/frames/legend_api_legend_service_input_frame.py → legacy_api/frames/legacy_api_legend_service_input_frame.py} +6 -6
- pylegend/extensions/tds/{legend_api/frames/legend_api_table_spec_input_frame.py → legacy_api/frames/legacy_api_table_spec_input_frame.py} +5 -5
- pylegend/extensions/tds/legendql_api/__init__.py +13 -0
- pylegend/extensions/tds/legendql_api/frames/__init__.py +13 -0
- pylegend/extensions/tds/legendql_api/frames/legendql_api_legend_service_input_frame.py +46 -0
- pylegend/extensions/tds/legendql_api/frames/legendql_api_table_spec_input_frame.py +36 -0
- pylegend/{legend_api_tds_client.py → legacy_api_tds_client.py} +15 -15
- {pylegend-0.2.2.dist-info → pylegend-0.4.0.dist-info}/METADATA +7 -8
- pylegend-0.4.0.dist-info/NOTICE +5 -0
- pylegend-0.4.0.dist-info/RECORD +155 -0
- {pylegend-0.2.2.dist-info → pylegend-0.4.0.dist-info}/WHEEL +1 -1
- pylegend/core/tds/legend_api/frames/legend_api_base_tds_frame.py +0 -294
- pylegend-0.2.2.dist-info/RECORD +0 -115
- /pylegend/core/{databse → database}/__init__.py +0 -0
- /pylegend/core/{databse → database}/sql_to_string/config.py +0 -0
- /pylegend/core/language/{operations → shared/operations}/__init__.py +0 -0
- /pylegend/core/tds/{legend_api → legacy_api}/__init__.py +0 -0
- /pylegend/core/tds/{legend_api → legacy_api}/frames/__init__.py +0 -0
- /pylegend/core/tds/{legend_api → legacy_api}/frames/functions/__init__.py +0 -0
- /pylegend/extensions/tds/{legend_api → legacy_api}/__init__.py +0 -0
- /pylegend/extensions/tds/{legend_api → legacy_api}/frames/__init__.py +0 -0
- {pylegend-0.2.2.dist-info → pylegend-0.4.0.dist-info}/LICENSE +0 -0
- {pylegend-0.2.2.dist-info → pylegend-0.4.0.dist-info}/LICENSE.spdx +0 -0
|
@@ -18,14 +18,16 @@ from pylegend._typing import (
|
|
|
18
18
|
PyLegendDict,
|
|
19
19
|
PyLegendCallable,
|
|
20
20
|
)
|
|
21
|
-
from pylegend.core.language.expression import (
|
|
21
|
+
from pylegend.core.language.shared.expression import (
|
|
22
22
|
PyLegendExpression,
|
|
23
23
|
)
|
|
24
|
+
from pylegend.core.language.shared.helpers import expr_has_matching_start_and_end_parentheses
|
|
24
25
|
from pylegend.core.sql.metamodel import (
|
|
25
26
|
Expression,
|
|
26
27
|
QuerySpecification,
|
|
27
28
|
)
|
|
28
29
|
from pylegend.core.tds.tds_frame import FrameToSqlConfig
|
|
30
|
+
from pylegend.core.tds.tds_frame import FrameToPureConfig
|
|
29
31
|
|
|
30
32
|
|
|
31
33
|
__all__: PyLegendSequence[str] = [
|
|
@@ -40,6 +42,7 @@ class PyLegendBinaryExpression(PyLegendExpression, metaclass=ABCMeta):
|
|
|
40
42
|
[Expression, Expression, PyLegendDict[str, QuerySpecification], FrameToSqlConfig],
|
|
41
43
|
Expression
|
|
42
44
|
]
|
|
45
|
+
__to_pure_func: PyLegendCallable[[str, str, FrameToPureConfig], str]
|
|
43
46
|
|
|
44
47
|
def __init__(
|
|
45
48
|
self,
|
|
@@ -48,11 +51,13 @@ class PyLegendBinaryExpression(PyLegendExpression, metaclass=ABCMeta):
|
|
|
48
51
|
to_sql_func: PyLegendCallable[
|
|
49
52
|
[Expression, Expression, PyLegendDict[str, QuerySpecification], FrameToSqlConfig],
|
|
50
53
|
Expression
|
|
51
|
-
]
|
|
54
|
+
],
|
|
55
|
+
to_pure_func: PyLegendCallable[[str, str, FrameToPureConfig], str]
|
|
52
56
|
) -> None:
|
|
53
57
|
self.__operand1 = operand1
|
|
54
58
|
self.__operand2 = operand2
|
|
55
59
|
self.__to_sql_func = to_sql_func
|
|
60
|
+
self.__to_pure_func = to_pure_func
|
|
56
61
|
|
|
57
62
|
def to_sql_expression(
|
|
58
63
|
self,
|
|
@@ -67,3 +72,30 @@ class PyLegendBinaryExpression(PyLegendExpression, metaclass=ABCMeta):
|
|
|
67
72
|
frame_name_to_base_query_map,
|
|
68
73
|
config
|
|
69
74
|
)
|
|
75
|
+
|
|
76
|
+
def to_pure_expression(self, config: FrameToPureConfig) -> str:
|
|
77
|
+
op1_expr = self.__operand1.to_pure_expression(config)
|
|
78
|
+
op2_expr = self.__operand2.to_pure_expression(config)
|
|
79
|
+
return self.__to_pure_func(op1_expr, op2_expr, config)
|
|
80
|
+
|
|
81
|
+
def to_pure_expression_with_to_one_on_both_operands(self, config: FrameToPureConfig) -> str:
|
|
82
|
+
op1_expr = self.__operand1.to_pure_expression(config)
|
|
83
|
+
op1_expr = (
|
|
84
|
+
op1_expr if self.__operand1.is_non_nullable() else
|
|
85
|
+
f"toOne({op1_expr[1:-1] if expr_has_matching_start_and_end_parentheses(op1_expr) else op1_expr})"
|
|
86
|
+
)
|
|
87
|
+
op2_expr = self.__operand2.to_pure_expression(config)
|
|
88
|
+
op2_expr = (
|
|
89
|
+
op2_expr if self.__operand2.is_non_nullable() else
|
|
90
|
+
f"toOne({op2_expr[1:-1] if expr_has_matching_start_and_end_parentheses(op2_expr) else op2_expr})"
|
|
91
|
+
)
|
|
92
|
+
return self.__to_pure_func(op1_expr, op2_expr, config)
|
|
93
|
+
|
|
94
|
+
def to_pure_expression_with_to_one_on_second_operand(self, config: FrameToPureConfig) -> str:
|
|
95
|
+
op1_expr = self.__operand1.to_pure_expression(config)
|
|
96
|
+
op2_expr = self.__operand2.to_pure_expression(config)
|
|
97
|
+
op2_expr = (
|
|
98
|
+
op2_expr if self.__operand2.is_non_nullable() else
|
|
99
|
+
f"toOne({op2_expr[1:-1] if expr_has_matching_start_and_end_parentheses(op2_expr) else op2_expr})"
|
|
100
|
+
)
|
|
101
|
+
return self.__to_pure_func(op1_expr, op2_expr, config)
|
|
@@ -16,11 +16,11 @@ from pylegend._typing import (
|
|
|
16
16
|
PyLegendSequence,
|
|
17
17
|
PyLegendDict,
|
|
18
18
|
)
|
|
19
|
-
from pylegend.core.language.expression import (
|
|
19
|
+
from pylegend.core.language.shared.expression import (
|
|
20
20
|
PyLegendExpressionBooleanReturn,
|
|
21
21
|
)
|
|
22
|
-
from pylegend.core.language.operations.binary_expression import PyLegendBinaryExpression
|
|
23
|
-
from pylegend.core.language.operations.unary_expression import PyLegendUnaryExpression
|
|
22
|
+
from pylegend.core.language.shared.operations.binary_expression import PyLegendBinaryExpression
|
|
23
|
+
from pylegend.core.language.shared.operations.unary_expression import PyLegendUnaryExpression
|
|
24
24
|
from pylegend.core.sql.metamodel import (
|
|
25
25
|
Expression,
|
|
26
26
|
QuerySpecification,
|
|
@@ -29,6 +29,7 @@ from pylegend.core.sql.metamodel import (
|
|
|
29
29
|
NotExpression,
|
|
30
30
|
)
|
|
31
31
|
from pylegend.core.tds.tds_frame import FrameToSqlConfig
|
|
32
|
+
from pylegend.core.tds.tds_frame import FrameToPureConfig
|
|
32
33
|
|
|
33
34
|
|
|
34
35
|
__all__: PyLegendSequence[str] = [
|
|
@@ -49,15 +50,26 @@ class PyLegendBooleanOrExpression(PyLegendBinaryExpression, PyLegendExpressionBo
|
|
|
49
50
|
) -> Expression:
|
|
50
51
|
return LogicalBinaryExpression(LogicalBinaryType.OR, expression1, expression2)
|
|
51
52
|
|
|
53
|
+
@staticmethod
|
|
54
|
+
def __to_pure_func(op1_expr: str, op2_expr: str, config: FrameToPureConfig) -> str:
|
|
55
|
+
return f"({op1_expr} || {op2_expr})"
|
|
56
|
+
|
|
52
57
|
def __init__(self, operand1: PyLegendExpressionBooleanReturn, operand2: PyLegendExpressionBooleanReturn) -> None:
|
|
53
58
|
PyLegendExpressionBooleanReturn.__init__(self)
|
|
54
59
|
PyLegendBinaryExpression.__init__(
|
|
55
60
|
self,
|
|
56
61
|
operand1,
|
|
57
62
|
operand2,
|
|
58
|
-
PyLegendBooleanOrExpression.__to_sql_func
|
|
63
|
+
PyLegendBooleanOrExpression.__to_sql_func,
|
|
64
|
+
PyLegendBooleanOrExpression.__to_pure_func
|
|
59
65
|
)
|
|
60
66
|
|
|
67
|
+
def is_non_nullable(self) -> bool:
|
|
68
|
+
return True
|
|
69
|
+
|
|
70
|
+
def to_pure_expression(self, config: FrameToPureConfig) -> str:
|
|
71
|
+
return PyLegendBinaryExpression.to_pure_expression_with_to_one_on_both_operands(self, config)
|
|
72
|
+
|
|
61
73
|
|
|
62
74
|
class PyLegendBooleanAndExpression(PyLegendBinaryExpression, PyLegendExpressionBooleanReturn):
|
|
63
75
|
|
|
@@ -70,15 +82,26 @@ class PyLegendBooleanAndExpression(PyLegendBinaryExpression, PyLegendExpressionB
|
|
|
70
82
|
) -> Expression:
|
|
71
83
|
return LogicalBinaryExpression(LogicalBinaryType.AND, expression1, expression2)
|
|
72
84
|
|
|
85
|
+
@staticmethod
|
|
86
|
+
def __to_pure_func(op1_expr: str, op2_expr: str, config: FrameToPureConfig) -> str:
|
|
87
|
+
return f"({op1_expr} && {op2_expr})"
|
|
88
|
+
|
|
73
89
|
def __init__(self, operand1: PyLegendExpressionBooleanReturn, operand2: PyLegendExpressionBooleanReturn) -> None:
|
|
74
90
|
PyLegendExpressionBooleanReturn.__init__(self)
|
|
75
91
|
PyLegendBinaryExpression.__init__(
|
|
76
92
|
self,
|
|
77
93
|
operand1,
|
|
78
94
|
operand2,
|
|
79
|
-
PyLegendBooleanAndExpression.__to_sql_func
|
|
95
|
+
PyLegendBooleanAndExpression.__to_sql_func,
|
|
96
|
+
PyLegendBooleanAndExpression.__to_pure_func
|
|
80
97
|
)
|
|
81
98
|
|
|
99
|
+
def is_non_nullable(self) -> bool:
|
|
100
|
+
return True
|
|
101
|
+
|
|
102
|
+
def to_pure_expression(self, config: FrameToPureConfig) -> str:
|
|
103
|
+
return PyLegendBinaryExpression.to_pure_expression_with_to_one_on_both_operands(self, config)
|
|
104
|
+
|
|
82
105
|
|
|
83
106
|
class PyLegendBooleanNotExpression(PyLegendUnaryExpression, PyLegendExpressionBooleanReturn):
|
|
84
107
|
|
|
@@ -90,10 +113,15 @@ class PyLegendBooleanNotExpression(PyLegendUnaryExpression, PyLegendExpressionBo
|
|
|
90
113
|
) -> Expression:
|
|
91
114
|
return NotExpression(expression)
|
|
92
115
|
|
|
116
|
+
@staticmethod
|
|
117
|
+
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
118
|
+
return f"{op_expr}->map(op | !$op)"
|
|
119
|
+
|
|
93
120
|
def __init__(self, operand: PyLegendExpressionBooleanReturn) -> None:
|
|
94
121
|
PyLegendExpressionBooleanReturn.__init__(self)
|
|
95
122
|
PyLegendUnaryExpression.__init__(
|
|
96
123
|
self,
|
|
97
124
|
operand,
|
|
98
|
-
PyLegendBooleanNotExpression.__to_sql_func
|
|
125
|
+
PyLegendBooleanNotExpression.__to_sql_func,
|
|
126
|
+
PyLegendBooleanNotExpression.__to_pure_func
|
|
99
127
|
)
|
|
@@ -16,7 +16,7 @@ from pylegend._typing import (
|
|
|
16
16
|
PyLegendSequence,
|
|
17
17
|
PyLegendDict,
|
|
18
18
|
)
|
|
19
|
-
from pylegend.core.language.expression import (
|
|
19
|
+
from pylegend.core.language.shared.expression import (
|
|
20
20
|
PyLegendExpression,
|
|
21
21
|
PyLegendExpressionIntegerReturn,
|
|
22
22
|
PyLegendExpressionFloatReturn,
|
|
@@ -25,9 +25,11 @@ from pylegend.core.language.expression import (
|
|
|
25
25
|
PyLegendExpressionStrictDateReturn,
|
|
26
26
|
PyLegendExpressionDateReturn,
|
|
27
27
|
)
|
|
28
|
-
from pylegend.core.language.operations.unary_expression import PyLegendUnaryExpression
|
|
29
|
-
from pylegend.core.language.
|
|
28
|
+
from pylegend.core.language.shared.operations.unary_expression import PyLegendUnaryExpression
|
|
29
|
+
from pylegend.core.language.shared.helpers import generate_pure_functional_call
|
|
30
|
+
from pylegend.core.language.shared.operations.binary_expression import PyLegendBinaryExpression
|
|
30
31
|
from pylegend.core.tds.tds_frame import FrameToSqlConfig
|
|
32
|
+
from pylegend.core.tds.tds_frame import FrameToPureConfig
|
|
31
33
|
from pylegend.core.sql.metamodel import (
|
|
32
34
|
Expression,
|
|
33
35
|
QuerySpecification,
|
|
@@ -84,12 +86,17 @@ class PyLegendCountExpression(PyLegendUnaryExpression, PyLegendExpressionInteger
|
|
|
84
86
|
) -> Expression:
|
|
85
87
|
return CountExpression(value=expression)
|
|
86
88
|
|
|
89
|
+
@staticmethod
|
|
90
|
+
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
91
|
+
return generate_pure_functional_call("count", [op_expr])
|
|
92
|
+
|
|
87
93
|
def __init__(self, operand: PyLegendExpression) -> None:
|
|
88
94
|
PyLegendExpressionIntegerReturn.__init__(self)
|
|
89
95
|
PyLegendUnaryExpression.__init__(
|
|
90
96
|
self,
|
|
91
97
|
operand,
|
|
92
|
-
PyLegendCountExpression.__to_sql_func
|
|
98
|
+
PyLegendCountExpression.__to_sql_func,
|
|
99
|
+
PyLegendCountExpression.__to_pure_func
|
|
93
100
|
)
|
|
94
101
|
|
|
95
102
|
|
|
@@ -103,12 +110,20 @@ class PyLegendDistinctCountExpression(PyLegendUnaryExpression, PyLegendExpressio
|
|
|
103
110
|
) -> Expression:
|
|
104
111
|
return DistinctCountExpression(value=expression)
|
|
105
112
|
|
|
113
|
+
@staticmethod
|
|
114
|
+
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
115
|
+
return generate_pure_functional_call(
|
|
116
|
+
"count",
|
|
117
|
+
[generate_pure_functional_call("distinct", [op_expr])]
|
|
118
|
+
)
|
|
119
|
+
|
|
106
120
|
def __init__(self, operand: PyLegendExpression) -> None:
|
|
107
121
|
PyLegendExpressionIntegerReturn.__init__(self)
|
|
108
122
|
PyLegendUnaryExpression.__init__(
|
|
109
123
|
self,
|
|
110
124
|
operand,
|
|
111
|
-
PyLegendDistinctCountExpression.__to_sql_func
|
|
125
|
+
PyLegendDistinctCountExpression.__to_sql_func,
|
|
126
|
+
PyLegendDistinctCountExpression.__to_pure_func
|
|
112
127
|
)
|
|
113
128
|
|
|
114
129
|
|
|
@@ -122,12 +137,17 @@ class PyLegendAverageExpression(PyLegendUnaryExpression, PyLegendExpressionFloat
|
|
|
122
137
|
) -> Expression:
|
|
123
138
|
return AverageExpression(value=expression)
|
|
124
139
|
|
|
140
|
+
@staticmethod
|
|
141
|
+
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
142
|
+
return generate_pure_functional_call("average", [op_expr])
|
|
143
|
+
|
|
125
144
|
def __init__(self, operand: PyLegendExpressionNumberReturn) -> None:
|
|
126
145
|
PyLegendExpressionFloatReturn.__init__(self)
|
|
127
146
|
PyLegendUnaryExpression.__init__(
|
|
128
147
|
self,
|
|
129
148
|
operand,
|
|
130
|
-
PyLegendAverageExpression.__to_sql_func
|
|
149
|
+
PyLegendAverageExpression.__to_sql_func,
|
|
150
|
+
PyLegendAverageExpression.__to_pure_func
|
|
131
151
|
)
|
|
132
152
|
|
|
133
153
|
|
|
@@ -141,12 +161,17 @@ class PyLegendIntegerMaxExpression(PyLegendUnaryExpression, PyLegendExpressionIn
|
|
|
141
161
|
) -> Expression:
|
|
142
162
|
return MaxExpression(value=expression)
|
|
143
163
|
|
|
164
|
+
@staticmethod
|
|
165
|
+
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
166
|
+
return generate_pure_functional_call("max", [op_expr])
|
|
167
|
+
|
|
144
168
|
def __init__(self, operand: PyLegendExpressionIntegerReturn) -> None:
|
|
145
169
|
PyLegendExpressionIntegerReturn.__init__(self)
|
|
146
170
|
PyLegendUnaryExpression.__init__(
|
|
147
171
|
self,
|
|
148
172
|
operand,
|
|
149
|
-
PyLegendIntegerMaxExpression.__to_sql_func
|
|
173
|
+
PyLegendIntegerMaxExpression.__to_sql_func,
|
|
174
|
+
PyLegendIntegerMaxExpression.__to_pure_func
|
|
150
175
|
)
|
|
151
176
|
|
|
152
177
|
|
|
@@ -160,12 +185,17 @@ class PyLegendIntegerMinExpression(PyLegendUnaryExpression, PyLegendExpressionIn
|
|
|
160
185
|
) -> Expression:
|
|
161
186
|
return MinExpression(value=expression)
|
|
162
187
|
|
|
188
|
+
@staticmethod
|
|
189
|
+
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
190
|
+
return generate_pure_functional_call("min", [op_expr])
|
|
191
|
+
|
|
163
192
|
def __init__(self, operand: PyLegendExpressionIntegerReturn) -> None:
|
|
164
193
|
PyLegendExpressionIntegerReturn.__init__(self)
|
|
165
194
|
PyLegendUnaryExpression.__init__(
|
|
166
195
|
self,
|
|
167
196
|
operand,
|
|
168
|
-
PyLegendIntegerMinExpression.__to_sql_func
|
|
197
|
+
PyLegendIntegerMinExpression.__to_sql_func,
|
|
198
|
+
PyLegendIntegerMinExpression.__to_pure_func
|
|
169
199
|
)
|
|
170
200
|
|
|
171
201
|
|
|
@@ -179,12 +209,17 @@ class PyLegendIntegerSumExpression(PyLegendUnaryExpression, PyLegendExpressionIn
|
|
|
179
209
|
) -> Expression:
|
|
180
210
|
return SumExpression(value=expression)
|
|
181
211
|
|
|
212
|
+
@staticmethod
|
|
213
|
+
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
214
|
+
return generate_pure_functional_call("sum", [op_expr])
|
|
215
|
+
|
|
182
216
|
def __init__(self, operand: PyLegendExpressionIntegerReturn) -> None:
|
|
183
217
|
PyLegendExpressionIntegerReturn.__init__(self)
|
|
184
218
|
PyLegendUnaryExpression.__init__(
|
|
185
219
|
self,
|
|
186
220
|
operand,
|
|
187
|
-
PyLegendIntegerSumExpression.__to_sql_func
|
|
221
|
+
PyLegendIntegerSumExpression.__to_sql_func,
|
|
222
|
+
PyLegendIntegerSumExpression.__to_pure_func
|
|
188
223
|
)
|
|
189
224
|
|
|
190
225
|
|
|
@@ -198,12 +233,17 @@ class PyLegendFloatMaxExpression(PyLegendUnaryExpression, PyLegendExpressionFloa
|
|
|
198
233
|
) -> Expression:
|
|
199
234
|
return MaxExpression(value=expression)
|
|
200
235
|
|
|
236
|
+
@staticmethod
|
|
237
|
+
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
238
|
+
return generate_pure_functional_call("max", [op_expr])
|
|
239
|
+
|
|
201
240
|
def __init__(self, operand: PyLegendExpressionFloatReturn) -> None:
|
|
202
241
|
PyLegendExpressionFloatReturn.__init__(self)
|
|
203
242
|
PyLegendUnaryExpression.__init__(
|
|
204
243
|
self,
|
|
205
244
|
operand,
|
|
206
|
-
PyLegendFloatMaxExpression.__to_sql_func
|
|
245
|
+
PyLegendFloatMaxExpression.__to_sql_func,
|
|
246
|
+
PyLegendFloatMaxExpression.__to_pure_func
|
|
207
247
|
)
|
|
208
248
|
|
|
209
249
|
|
|
@@ -217,12 +257,17 @@ class PyLegendFloatMinExpression(PyLegendUnaryExpression, PyLegendExpressionFloa
|
|
|
217
257
|
) -> Expression:
|
|
218
258
|
return MinExpression(value=expression)
|
|
219
259
|
|
|
260
|
+
@staticmethod
|
|
261
|
+
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
262
|
+
return generate_pure_functional_call("min", [op_expr])
|
|
263
|
+
|
|
220
264
|
def __init__(self, operand: PyLegendExpressionFloatReturn) -> None:
|
|
221
265
|
PyLegendExpressionFloatReturn.__init__(self)
|
|
222
266
|
PyLegendUnaryExpression.__init__(
|
|
223
267
|
self,
|
|
224
268
|
operand,
|
|
225
|
-
PyLegendFloatMinExpression.__to_sql_func
|
|
269
|
+
PyLegendFloatMinExpression.__to_sql_func,
|
|
270
|
+
PyLegendFloatMinExpression.__to_pure_func
|
|
226
271
|
)
|
|
227
272
|
|
|
228
273
|
|
|
@@ -236,12 +281,17 @@ class PyLegendFloatSumExpression(PyLegendUnaryExpression, PyLegendExpressionFloa
|
|
|
236
281
|
) -> Expression:
|
|
237
282
|
return SumExpression(value=expression)
|
|
238
283
|
|
|
284
|
+
@staticmethod
|
|
285
|
+
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
286
|
+
return generate_pure_functional_call("sum", [op_expr])
|
|
287
|
+
|
|
239
288
|
def __init__(self, operand: PyLegendExpressionFloatReturn) -> None:
|
|
240
289
|
PyLegendExpressionFloatReturn.__init__(self)
|
|
241
290
|
PyLegendUnaryExpression.__init__(
|
|
242
291
|
self,
|
|
243
292
|
operand,
|
|
244
|
-
PyLegendFloatSumExpression.__to_sql_func
|
|
293
|
+
PyLegendFloatSumExpression.__to_sql_func,
|
|
294
|
+
PyLegendFloatSumExpression.__to_pure_func
|
|
245
295
|
)
|
|
246
296
|
|
|
247
297
|
|
|
@@ -255,12 +305,17 @@ class PyLegendNumberMaxExpression(PyLegendUnaryExpression, PyLegendExpressionNum
|
|
|
255
305
|
) -> Expression:
|
|
256
306
|
return MaxExpression(value=expression)
|
|
257
307
|
|
|
308
|
+
@staticmethod
|
|
309
|
+
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
310
|
+
return generate_pure_functional_call("max", [op_expr])
|
|
311
|
+
|
|
258
312
|
def __init__(self, operand: PyLegendExpressionNumberReturn) -> None:
|
|
259
313
|
PyLegendExpressionNumberReturn.__init__(self)
|
|
260
314
|
PyLegendUnaryExpression.__init__(
|
|
261
315
|
self,
|
|
262
316
|
operand,
|
|
263
|
-
PyLegendNumberMaxExpression.__to_sql_func
|
|
317
|
+
PyLegendNumberMaxExpression.__to_sql_func,
|
|
318
|
+
PyLegendNumberMaxExpression.__to_pure_func
|
|
264
319
|
)
|
|
265
320
|
|
|
266
321
|
|
|
@@ -274,12 +329,17 @@ class PyLegendNumberMinExpression(PyLegendUnaryExpression, PyLegendExpressionNum
|
|
|
274
329
|
) -> Expression:
|
|
275
330
|
return MinExpression(value=expression)
|
|
276
331
|
|
|
332
|
+
@staticmethod
|
|
333
|
+
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
334
|
+
return generate_pure_functional_call("min", [op_expr])
|
|
335
|
+
|
|
277
336
|
def __init__(self, operand: PyLegendExpressionNumberReturn) -> None:
|
|
278
337
|
PyLegendExpressionNumberReturn.__init__(self)
|
|
279
338
|
PyLegendUnaryExpression.__init__(
|
|
280
339
|
self,
|
|
281
340
|
operand,
|
|
282
|
-
PyLegendNumberMinExpression.__to_sql_func
|
|
341
|
+
PyLegendNumberMinExpression.__to_sql_func,
|
|
342
|
+
PyLegendNumberMinExpression.__to_pure_func
|
|
283
343
|
)
|
|
284
344
|
|
|
285
345
|
|
|
@@ -293,12 +353,17 @@ class PyLegendNumberSumExpression(PyLegendUnaryExpression, PyLegendExpressionNum
|
|
|
293
353
|
) -> Expression:
|
|
294
354
|
return SumExpression(value=expression)
|
|
295
355
|
|
|
356
|
+
@staticmethod
|
|
357
|
+
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
358
|
+
return generate_pure_functional_call("sum", [op_expr])
|
|
359
|
+
|
|
296
360
|
def __init__(self, operand: PyLegendExpressionNumberReturn) -> None:
|
|
297
361
|
PyLegendExpressionNumberReturn.__init__(self)
|
|
298
362
|
PyLegendUnaryExpression.__init__(
|
|
299
363
|
self,
|
|
300
364
|
operand,
|
|
301
|
-
PyLegendNumberSumExpression.__to_sql_func
|
|
365
|
+
PyLegendNumberSumExpression.__to_sql_func,
|
|
366
|
+
PyLegendNumberSumExpression.__to_pure_func
|
|
302
367
|
)
|
|
303
368
|
|
|
304
369
|
|
|
@@ -312,12 +377,17 @@ class PyLegendStdDevSampleExpression(PyLegendUnaryExpression, PyLegendExpression
|
|
|
312
377
|
) -> Expression:
|
|
313
378
|
return StdDevSampleExpression(value=expression)
|
|
314
379
|
|
|
380
|
+
@staticmethod
|
|
381
|
+
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
382
|
+
return generate_pure_functional_call("stdDevSample", [op_expr])
|
|
383
|
+
|
|
315
384
|
def __init__(self, operand: PyLegendExpressionNumberReturn) -> None:
|
|
316
385
|
PyLegendExpressionNumberReturn.__init__(self)
|
|
317
386
|
PyLegendUnaryExpression.__init__(
|
|
318
387
|
self,
|
|
319
388
|
operand,
|
|
320
|
-
PyLegendStdDevSampleExpression.__to_sql_func
|
|
389
|
+
PyLegendStdDevSampleExpression.__to_sql_func,
|
|
390
|
+
PyLegendStdDevSampleExpression.__to_pure_func
|
|
321
391
|
)
|
|
322
392
|
|
|
323
393
|
|
|
@@ -331,12 +401,17 @@ class PyLegendStdDevPopulationExpression(PyLegendUnaryExpression, PyLegendExpres
|
|
|
331
401
|
) -> Expression:
|
|
332
402
|
return StdDevPopulationExpression(value=expression)
|
|
333
403
|
|
|
404
|
+
@staticmethod
|
|
405
|
+
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
406
|
+
return generate_pure_functional_call("stdDevPopulation", [op_expr])
|
|
407
|
+
|
|
334
408
|
def __init__(self, operand: PyLegendExpressionNumberReturn) -> None:
|
|
335
409
|
PyLegendExpressionNumberReturn.__init__(self)
|
|
336
410
|
PyLegendUnaryExpression.__init__(
|
|
337
411
|
self,
|
|
338
412
|
operand,
|
|
339
|
-
PyLegendStdDevPopulationExpression.__to_sql_func
|
|
413
|
+
PyLegendStdDevPopulationExpression.__to_sql_func,
|
|
414
|
+
PyLegendStdDevPopulationExpression.__to_pure_func
|
|
340
415
|
)
|
|
341
416
|
|
|
342
417
|
|
|
@@ -350,12 +425,17 @@ class PyLegendVarianceSampleExpression(PyLegendUnaryExpression, PyLegendExpressi
|
|
|
350
425
|
) -> Expression:
|
|
351
426
|
return VarianceSampleExpression(value=expression)
|
|
352
427
|
|
|
428
|
+
@staticmethod
|
|
429
|
+
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
430
|
+
return generate_pure_functional_call("varianceSample", [op_expr])
|
|
431
|
+
|
|
353
432
|
def __init__(self, operand: PyLegendExpressionNumberReturn) -> None:
|
|
354
433
|
PyLegendExpressionNumberReturn.__init__(self)
|
|
355
434
|
PyLegendUnaryExpression.__init__(
|
|
356
435
|
self,
|
|
357
436
|
operand,
|
|
358
|
-
PyLegendVarianceSampleExpression.__to_sql_func
|
|
437
|
+
PyLegendVarianceSampleExpression.__to_sql_func,
|
|
438
|
+
PyLegendVarianceSampleExpression.__to_pure_func
|
|
359
439
|
)
|
|
360
440
|
|
|
361
441
|
|
|
@@ -369,12 +449,17 @@ class PyLegendVariancePopulationExpression(PyLegendUnaryExpression, PyLegendExpr
|
|
|
369
449
|
) -> Expression:
|
|
370
450
|
return VariancePopulationExpression(value=expression)
|
|
371
451
|
|
|
452
|
+
@staticmethod
|
|
453
|
+
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
454
|
+
return generate_pure_functional_call("variancePopulation", [op_expr])
|
|
455
|
+
|
|
372
456
|
def __init__(self, operand: PyLegendExpressionNumberReturn) -> None:
|
|
373
457
|
PyLegendExpressionNumberReturn.__init__(self)
|
|
374
458
|
PyLegendUnaryExpression.__init__(
|
|
375
459
|
self,
|
|
376
460
|
operand,
|
|
377
|
-
PyLegendVariancePopulationExpression.__to_sql_func
|
|
461
|
+
PyLegendVariancePopulationExpression.__to_sql_func,
|
|
462
|
+
PyLegendVariancePopulationExpression.__to_pure_func
|
|
378
463
|
)
|
|
379
464
|
|
|
380
465
|
|
|
@@ -388,12 +473,17 @@ class PyLegendStringMaxExpression(PyLegendUnaryExpression, PyLegendExpressionStr
|
|
|
388
473
|
) -> Expression:
|
|
389
474
|
return MaxExpression(value=expression)
|
|
390
475
|
|
|
476
|
+
@staticmethod
|
|
477
|
+
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
478
|
+
return generate_pure_functional_call("max", [op_expr])
|
|
479
|
+
|
|
391
480
|
def __init__(self, operand: PyLegendExpressionStringReturn) -> None:
|
|
392
481
|
PyLegendExpressionStringReturn.__init__(self)
|
|
393
482
|
PyLegendUnaryExpression.__init__(
|
|
394
483
|
self,
|
|
395
484
|
operand,
|
|
396
|
-
PyLegendStringMaxExpression.__to_sql_func
|
|
485
|
+
PyLegendStringMaxExpression.__to_sql_func,
|
|
486
|
+
PyLegendStringMaxExpression.__to_pure_func
|
|
397
487
|
)
|
|
398
488
|
|
|
399
489
|
|
|
@@ -407,12 +497,17 @@ class PyLegendStringMinExpression(PyLegendUnaryExpression, PyLegendExpressionStr
|
|
|
407
497
|
) -> Expression:
|
|
408
498
|
return MinExpression(value=expression)
|
|
409
499
|
|
|
500
|
+
@staticmethod
|
|
501
|
+
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
502
|
+
return generate_pure_functional_call("min", [op_expr])
|
|
503
|
+
|
|
410
504
|
def __init__(self, operand: PyLegendExpressionStringReturn) -> None:
|
|
411
505
|
PyLegendExpressionStringReturn.__init__(self)
|
|
412
506
|
PyLegendUnaryExpression.__init__(
|
|
413
507
|
self,
|
|
414
508
|
operand,
|
|
415
|
-
PyLegendStringMinExpression.__to_sql_func
|
|
509
|
+
PyLegendStringMinExpression.__to_sql_func,
|
|
510
|
+
PyLegendStringMinExpression.__to_pure_func
|
|
416
511
|
)
|
|
417
512
|
|
|
418
513
|
|
|
@@ -427,13 +522,18 @@ class PyLegendJoinStringsExpression(PyLegendBinaryExpression, PyLegendExpression
|
|
|
427
522
|
) -> Expression:
|
|
428
523
|
return JoinStringsExpression(value=expression1, other=expression2)
|
|
429
524
|
|
|
525
|
+
@staticmethod
|
|
526
|
+
def __to_pure_func(op1_expr: str, op2_expr: str, config: FrameToPureConfig) -> str:
|
|
527
|
+
return generate_pure_functional_call("joinStrings", [op1_expr, op2_expr])
|
|
528
|
+
|
|
430
529
|
def __init__(self, operand1: PyLegendExpressionStringReturn, operand2: PyLegendExpressionStringReturn) -> None:
|
|
431
530
|
PyLegendExpressionStringReturn.__init__(self)
|
|
432
531
|
PyLegendBinaryExpression.__init__(
|
|
433
532
|
self,
|
|
434
533
|
operand1,
|
|
435
534
|
operand2,
|
|
436
|
-
PyLegendJoinStringsExpression.__to_sql_func
|
|
535
|
+
PyLegendJoinStringsExpression.__to_sql_func,
|
|
536
|
+
PyLegendJoinStringsExpression.__to_pure_func
|
|
437
537
|
)
|
|
438
538
|
|
|
439
539
|
|
|
@@ -447,12 +547,17 @@ class PyLegendStrictDateMaxExpression(PyLegendUnaryExpression, PyLegendExpressio
|
|
|
447
547
|
) -> Expression:
|
|
448
548
|
return MaxExpression(value=expression)
|
|
449
549
|
|
|
550
|
+
@staticmethod
|
|
551
|
+
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
552
|
+
return generate_pure_functional_call("max", [op_expr])
|
|
553
|
+
|
|
450
554
|
def __init__(self, operand: PyLegendExpressionStrictDateReturn) -> None:
|
|
451
555
|
PyLegendExpressionStrictDateReturn.__init__(self)
|
|
452
556
|
PyLegendUnaryExpression.__init__(
|
|
453
557
|
self,
|
|
454
558
|
operand,
|
|
455
|
-
PyLegendStrictDateMaxExpression.__to_sql_func
|
|
559
|
+
PyLegendStrictDateMaxExpression.__to_sql_func,
|
|
560
|
+
PyLegendStrictDateMaxExpression.__to_pure_func
|
|
456
561
|
)
|
|
457
562
|
|
|
458
563
|
|
|
@@ -466,12 +571,17 @@ class PyLegendStrictDateMinExpression(PyLegendUnaryExpression, PyLegendExpressio
|
|
|
466
571
|
) -> Expression:
|
|
467
572
|
return MinExpression(value=expression)
|
|
468
573
|
|
|
574
|
+
@staticmethod
|
|
575
|
+
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
576
|
+
return generate_pure_functional_call("min", [op_expr])
|
|
577
|
+
|
|
469
578
|
def __init__(self, operand: PyLegendExpressionStrictDateReturn) -> None:
|
|
470
579
|
PyLegendExpressionStrictDateReturn.__init__(self)
|
|
471
580
|
PyLegendUnaryExpression.__init__(
|
|
472
581
|
self,
|
|
473
582
|
operand,
|
|
474
|
-
PyLegendStrictDateMinExpression.__to_sql_func
|
|
583
|
+
PyLegendStrictDateMinExpression.__to_sql_func,
|
|
584
|
+
PyLegendStrictDateMinExpression.__to_pure_func
|
|
475
585
|
)
|
|
476
586
|
|
|
477
587
|
|
|
@@ -485,12 +595,17 @@ class PyLegendDateMaxExpression(PyLegendUnaryExpression, PyLegendExpressionDateR
|
|
|
485
595
|
) -> Expression:
|
|
486
596
|
return MaxExpression(value=expression)
|
|
487
597
|
|
|
598
|
+
@staticmethod
|
|
599
|
+
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
600
|
+
return generate_pure_functional_call("max", [op_expr])
|
|
601
|
+
|
|
488
602
|
def __init__(self, operand: PyLegendExpressionDateReturn) -> None:
|
|
489
603
|
PyLegendExpressionDateReturn.__init__(self)
|
|
490
604
|
PyLegendUnaryExpression.__init__(
|
|
491
605
|
self,
|
|
492
606
|
operand,
|
|
493
|
-
PyLegendDateMaxExpression.__to_sql_func
|
|
607
|
+
PyLegendDateMaxExpression.__to_sql_func,
|
|
608
|
+
PyLegendDateMaxExpression.__to_pure_func
|
|
494
609
|
)
|
|
495
610
|
|
|
496
611
|
|
|
@@ -504,10 +619,15 @@ class PyLegendDateMinExpression(PyLegendUnaryExpression, PyLegendExpressionDateR
|
|
|
504
619
|
) -> Expression:
|
|
505
620
|
return MinExpression(value=expression)
|
|
506
621
|
|
|
622
|
+
@staticmethod
|
|
623
|
+
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
624
|
+
return generate_pure_functional_call("min", [op_expr])
|
|
625
|
+
|
|
507
626
|
def __init__(self, operand: PyLegendExpressionDateReturn) -> None:
|
|
508
627
|
PyLegendExpressionDateReturn.__init__(self)
|
|
509
628
|
PyLegendUnaryExpression.__init__(
|
|
510
629
|
self,
|
|
511
630
|
operand,
|
|
512
|
-
PyLegendDateMinExpression.__to_sql_func
|
|
631
|
+
PyLegendDateMinExpression.__to_sql_func,
|
|
632
|
+
PyLegendDateMinExpression.__to_pure_func
|
|
513
633
|
)
|