pylegend 0.3.0__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 +7 -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 +7 -1
- pylegend/core/request/auth.py +55 -1
- 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.3.0.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.3.0.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.3.0.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.3.0.dist-info → pylegend-0.4.0.dist-info}/LICENSE +0 -0
- {pylegend-0.3.0.dist-info → pylegend-0.4.0.dist-info}/LICENSE.spdx +0 -0
|
@@ -16,15 +16,17 @@ 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
|
PyLegendExpressionDateReturn,
|
|
21
21
|
PyLegendExpressionDateTimeReturn,
|
|
22
22
|
PyLegendExpressionStrictDateReturn,
|
|
23
23
|
PyLegendExpressionIntegerReturn,
|
|
24
24
|
)
|
|
25
|
-
from pylegend.core.language.operations.nullary_expression import PyLegendNullaryExpression
|
|
26
|
-
from pylegend.core.language.operations.unary_expression import PyLegendUnaryExpression
|
|
25
|
+
from pylegend.core.language.shared.operations.nullary_expression import PyLegendNullaryExpression
|
|
26
|
+
from pylegend.core.language.shared.operations.unary_expression import PyLegendUnaryExpression
|
|
27
|
+
from pylegend.core.language.shared.helpers import generate_pure_functional_call
|
|
27
28
|
from pylegend.core.tds.tds_frame import FrameToSqlConfig
|
|
29
|
+
from pylegend.core.tds.tds_frame import FrameToPureConfig
|
|
28
30
|
from pylegend.core.sql.metamodel import (
|
|
29
31
|
Expression,
|
|
30
32
|
QuerySpecification,
|
|
@@ -32,6 +34,8 @@ from pylegend.core.sql.metamodel import (
|
|
|
32
34
|
from pylegend.core.sql.metamodel import (
|
|
33
35
|
CurrentTime,
|
|
34
36
|
CurrentTimeType,
|
|
37
|
+
Cast,
|
|
38
|
+
ColumnType,
|
|
35
39
|
)
|
|
36
40
|
from pylegend.core.sql.metamodel_extension import (
|
|
37
41
|
FirstDayOfYearExpression,
|
|
@@ -78,6 +82,7 @@ __all__: PyLegendSequence[str] = [
|
|
|
78
82
|
"PyLegendEpochExpression",
|
|
79
83
|
"PyLegendTodayExpression",
|
|
80
84
|
"PyLegendNowExpression",
|
|
85
|
+
"PyLegendDatePartExpression",
|
|
81
86
|
]
|
|
82
87
|
|
|
83
88
|
|
|
@@ -91,12 +96,17 @@ class PyLegendFirstDayOfYearExpression(PyLegendUnaryExpression, PyLegendExpressi
|
|
|
91
96
|
) -> Expression:
|
|
92
97
|
return FirstDayOfYearExpression(expression)
|
|
93
98
|
|
|
99
|
+
@staticmethod
|
|
100
|
+
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
101
|
+
return generate_pure_functional_call("firstDayOfYear", [op_expr], auto_map=True)
|
|
102
|
+
|
|
94
103
|
def __init__(self, operand: PyLegendExpressionDateReturn) -> None:
|
|
95
104
|
PyLegendExpressionDateReturn.__init__(self)
|
|
96
105
|
PyLegendUnaryExpression.__init__(
|
|
97
106
|
self,
|
|
98
107
|
operand,
|
|
99
|
-
PyLegendFirstDayOfYearExpression.__to_sql_func
|
|
108
|
+
PyLegendFirstDayOfYearExpression.__to_sql_func,
|
|
109
|
+
PyLegendFirstDayOfYearExpression.__to_pure_func
|
|
100
110
|
)
|
|
101
111
|
|
|
102
112
|
|
|
@@ -110,12 +120,17 @@ class PyLegendFirstDayOfQuarterExpression(PyLegendUnaryExpression, PyLegendExpre
|
|
|
110
120
|
) -> Expression:
|
|
111
121
|
return FirstDayOfQuarterExpression(expression)
|
|
112
122
|
|
|
123
|
+
@staticmethod
|
|
124
|
+
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
125
|
+
return generate_pure_functional_call("firstDayOfQuarter", [op_expr], auto_map=True)
|
|
126
|
+
|
|
113
127
|
def __init__(self, operand: PyLegendExpressionDateReturn) -> None:
|
|
114
128
|
PyLegendExpressionDateReturn.__init__(self)
|
|
115
129
|
PyLegendUnaryExpression.__init__(
|
|
116
130
|
self,
|
|
117
131
|
operand,
|
|
118
|
-
PyLegendFirstDayOfQuarterExpression.__to_sql_func
|
|
132
|
+
PyLegendFirstDayOfQuarterExpression.__to_sql_func,
|
|
133
|
+
PyLegendFirstDayOfQuarterExpression.__to_pure_func
|
|
119
134
|
)
|
|
120
135
|
|
|
121
136
|
|
|
@@ -129,12 +144,17 @@ class PyLegendFirstDayOfMonthExpression(PyLegendUnaryExpression, PyLegendExpress
|
|
|
129
144
|
) -> Expression:
|
|
130
145
|
return FirstDayOfMonthExpression(expression)
|
|
131
146
|
|
|
147
|
+
@staticmethod
|
|
148
|
+
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
149
|
+
return generate_pure_functional_call("firstDayOfMonth", [op_expr], auto_map=True)
|
|
150
|
+
|
|
132
151
|
def __init__(self, operand: PyLegendExpressionDateReturn) -> None:
|
|
133
152
|
PyLegendExpressionDateReturn.__init__(self)
|
|
134
153
|
PyLegendUnaryExpression.__init__(
|
|
135
154
|
self,
|
|
136
155
|
operand,
|
|
137
|
-
PyLegendFirstDayOfMonthExpression.__to_sql_func
|
|
156
|
+
PyLegendFirstDayOfMonthExpression.__to_sql_func,
|
|
157
|
+
PyLegendFirstDayOfMonthExpression.__to_pure_func
|
|
138
158
|
)
|
|
139
159
|
|
|
140
160
|
|
|
@@ -148,12 +168,17 @@ class PyLegendFirstDayOfWeekExpression(PyLegendUnaryExpression, PyLegendExpressi
|
|
|
148
168
|
) -> Expression:
|
|
149
169
|
return FirstDayOfWeekExpression(expression)
|
|
150
170
|
|
|
171
|
+
@staticmethod
|
|
172
|
+
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
173
|
+
return generate_pure_functional_call("firstDayOfWeek", [op_expr], auto_map=True)
|
|
174
|
+
|
|
151
175
|
def __init__(self, operand: PyLegendExpressionDateReturn) -> None:
|
|
152
176
|
PyLegendExpressionDateReturn.__init__(self)
|
|
153
177
|
PyLegendUnaryExpression.__init__(
|
|
154
178
|
self,
|
|
155
179
|
operand,
|
|
156
|
-
PyLegendFirstDayOfWeekExpression.__to_sql_func
|
|
180
|
+
PyLegendFirstDayOfWeekExpression.__to_sql_func,
|
|
181
|
+
PyLegendFirstDayOfWeekExpression.__to_pure_func
|
|
157
182
|
)
|
|
158
183
|
|
|
159
184
|
|
|
@@ -167,12 +192,17 @@ class PyLegendFirstHourOfDayExpression(PyLegendUnaryExpression, PyLegendExpressi
|
|
|
167
192
|
) -> Expression:
|
|
168
193
|
return FirstHourOfDayExpression(expression)
|
|
169
194
|
|
|
195
|
+
@staticmethod
|
|
196
|
+
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
197
|
+
return generate_pure_functional_call("firstHourOfDay", [op_expr], auto_map=True)
|
|
198
|
+
|
|
170
199
|
def __init__(self, operand: PyLegendExpressionDateReturn) -> None:
|
|
171
200
|
PyLegendExpressionDateTimeReturn.__init__(self)
|
|
172
201
|
PyLegendUnaryExpression.__init__(
|
|
173
202
|
self,
|
|
174
203
|
operand,
|
|
175
|
-
PyLegendFirstHourOfDayExpression.__to_sql_func
|
|
204
|
+
PyLegendFirstHourOfDayExpression.__to_sql_func,
|
|
205
|
+
PyLegendFirstHourOfDayExpression.__to_pure_func
|
|
176
206
|
)
|
|
177
207
|
|
|
178
208
|
|
|
@@ -186,12 +216,17 @@ class PyLegendFirstMinuteOfHourExpression(PyLegendUnaryExpression, PyLegendExpre
|
|
|
186
216
|
) -> Expression:
|
|
187
217
|
return FirstMinuteOfHourExpression(expression)
|
|
188
218
|
|
|
219
|
+
@staticmethod
|
|
220
|
+
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
221
|
+
return generate_pure_functional_call("firstMinuteOfHour", [op_expr], auto_map=True)
|
|
222
|
+
|
|
189
223
|
def __init__(self, operand: PyLegendExpressionDateReturn) -> None:
|
|
190
224
|
PyLegendExpressionDateTimeReturn.__init__(self)
|
|
191
225
|
PyLegendUnaryExpression.__init__(
|
|
192
226
|
self,
|
|
193
227
|
operand,
|
|
194
|
-
PyLegendFirstMinuteOfHourExpression.__to_sql_func
|
|
228
|
+
PyLegendFirstMinuteOfHourExpression.__to_sql_func,
|
|
229
|
+
PyLegendFirstMinuteOfHourExpression.__to_pure_func
|
|
195
230
|
)
|
|
196
231
|
|
|
197
232
|
|
|
@@ -205,12 +240,17 @@ class PyLegendFirstSecondOfMinuteExpression(PyLegendUnaryExpression, PyLegendExp
|
|
|
205
240
|
) -> Expression:
|
|
206
241
|
return FirstSecondOfMinuteExpression(expression)
|
|
207
242
|
|
|
243
|
+
@staticmethod
|
|
244
|
+
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
245
|
+
return generate_pure_functional_call("firstSecondOfMinute", [op_expr], auto_map=True)
|
|
246
|
+
|
|
208
247
|
def __init__(self, operand: PyLegendExpressionDateReturn) -> None:
|
|
209
248
|
PyLegendExpressionDateTimeReturn.__init__(self)
|
|
210
249
|
PyLegendUnaryExpression.__init__(
|
|
211
250
|
self,
|
|
212
251
|
operand,
|
|
213
|
-
PyLegendFirstSecondOfMinuteExpression.__to_sql_func
|
|
252
|
+
PyLegendFirstSecondOfMinuteExpression.__to_sql_func,
|
|
253
|
+
PyLegendFirstSecondOfMinuteExpression.__to_pure_func
|
|
214
254
|
)
|
|
215
255
|
|
|
216
256
|
|
|
@@ -224,12 +264,17 @@ class PyLegendFirstMillisecondOfSecondExpression(PyLegendUnaryExpression, PyLege
|
|
|
224
264
|
) -> Expression:
|
|
225
265
|
return FirstMillisecondOfSecondExpression(expression)
|
|
226
266
|
|
|
267
|
+
@staticmethod
|
|
268
|
+
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
269
|
+
return generate_pure_functional_call("firstMillisecondOfSecond", [op_expr], auto_map=True)
|
|
270
|
+
|
|
227
271
|
def __init__(self, operand: PyLegendExpressionDateReturn) -> None:
|
|
228
272
|
PyLegendExpressionDateTimeReturn.__init__(self)
|
|
229
273
|
PyLegendUnaryExpression.__init__(
|
|
230
274
|
self,
|
|
231
275
|
operand,
|
|
232
|
-
PyLegendFirstMillisecondOfSecondExpression.__to_sql_func
|
|
276
|
+
PyLegendFirstMillisecondOfSecondExpression.__to_sql_func,
|
|
277
|
+
PyLegendFirstMillisecondOfSecondExpression.__to_pure_func
|
|
233
278
|
)
|
|
234
279
|
|
|
235
280
|
|
|
@@ -243,12 +288,17 @@ class PyLegendYearExpression(PyLegendUnaryExpression, PyLegendExpressionIntegerR
|
|
|
243
288
|
) -> Expression:
|
|
244
289
|
return YearExpression(expression)
|
|
245
290
|
|
|
291
|
+
@staticmethod
|
|
292
|
+
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
293
|
+
return generate_pure_functional_call("year", [op_expr], auto_map=True)
|
|
294
|
+
|
|
246
295
|
def __init__(self, operand: PyLegendExpressionDateReturn) -> None:
|
|
247
296
|
PyLegendExpressionIntegerReturn.__init__(self)
|
|
248
297
|
PyLegendUnaryExpression.__init__(
|
|
249
298
|
self,
|
|
250
299
|
operand,
|
|
251
|
-
PyLegendYearExpression.__to_sql_func
|
|
300
|
+
PyLegendYearExpression.__to_sql_func,
|
|
301
|
+
PyLegendYearExpression.__to_pure_func
|
|
252
302
|
)
|
|
253
303
|
|
|
254
304
|
|
|
@@ -262,12 +312,17 @@ class PyLegendQuarterExpression(PyLegendUnaryExpression, PyLegendExpressionInteg
|
|
|
262
312
|
) -> Expression:
|
|
263
313
|
return QuarterExpression(expression)
|
|
264
314
|
|
|
315
|
+
@staticmethod
|
|
316
|
+
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
317
|
+
return generate_pure_functional_call("quarter", [op_expr], auto_map=True)
|
|
318
|
+
|
|
265
319
|
def __init__(self, operand: PyLegendExpressionDateReturn) -> None:
|
|
266
320
|
PyLegendExpressionIntegerReturn.__init__(self)
|
|
267
321
|
PyLegendUnaryExpression.__init__(
|
|
268
322
|
self,
|
|
269
323
|
operand,
|
|
270
|
-
PyLegendQuarterExpression.__to_sql_func
|
|
324
|
+
PyLegendQuarterExpression.__to_sql_func,
|
|
325
|
+
PyLegendQuarterExpression.__to_pure_func
|
|
271
326
|
)
|
|
272
327
|
|
|
273
328
|
|
|
@@ -281,12 +336,17 @@ class PyLegendMonthExpression(PyLegendUnaryExpression, PyLegendExpressionInteger
|
|
|
281
336
|
) -> Expression:
|
|
282
337
|
return MonthExpression(expression)
|
|
283
338
|
|
|
339
|
+
@staticmethod
|
|
340
|
+
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
341
|
+
return generate_pure_functional_call("month", [op_expr], auto_map=True)
|
|
342
|
+
|
|
284
343
|
def __init__(self, operand: PyLegendExpressionDateReturn) -> None:
|
|
285
344
|
PyLegendExpressionIntegerReturn.__init__(self)
|
|
286
345
|
PyLegendUnaryExpression.__init__(
|
|
287
346
|
self,
|
|
288
347
|
operand,
|
|
289
|
-
PyLegendMonthExpression.__to_sql_func
|
|
348
|
+
PyLegendMonthExpression.__to_sql_func,
|
|
349
|
+
PyLegendMonthExpression.__to_pure_func
|
|
290
350
|
)
|
|
291
351
|
|
|
292
352
|
|
|
@@ -300,12 +360,17 @@ class PyLegendWeekOfYearExpression(PyLegendUnaryExpression, PyLegendExpressionIn
|
|
|
300
360
|
) -> Expression:
|
|
301
361
|
return WeekOfYearExpression(expression)
|
|
302
362
|
|
|
363
|
+
@staticmethod
|
|
364
|
+
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
365
|
+
return generate_pure_functional_call("weekOfYear", [op_expr], auto_map=True)
|
|
366
|
+
|
|
303
367
|
def __init__(self, operand: PyLegendExpressionDateReturn) -> None:
|
|
304
368
|
PyLegendExpressionIntegerReturn.__init__(self)
|
|
305
369
|
PyLegendUnaryExpression.__init__(
|
|
306
370
|
self,
|
|
307
371
|
operand,
|
|
308
|
-
PyLegendWeekOfYearExpression.__to_sql_func
|
|
372
|
+
PyLegendWeekOfYearExpression.__to_sql_func,
|
|
373
|
+
PyLegendWeekOfYearExpression.__to_pure_func
|
|
309
374
|
)
|
|
310
375
|
|
|
311
376
|
|
|
@@ -319,12 +384,17 @@ class PyLegendDayOfYearExpression(PyLegendUnaryExpression, PyLegendExpressionInt
|
|
|
319
384
|
) -> Expression:
|
|
320
385
|
return DayOfYearExpression(expression)
|
|
321
386
|
|
|
387
|
+
@staticmethod
|
|
388
|
+
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
389
|
+
return generate_pure_functional_call("dayOfYear", [op_expr], auto_map=True)
|
|
390
|
+
|
|
322
391
|
def __init__(self, operand: PyLegendExpressionDateReturn) -> None:
|
|
323
392
|
PyLegendExpressionIntegerReturn.__init__(self)
|
|
324
393
|
PyLegendUnaryExpression.__init__(
|
|
325
394
|
self,
|
|
326
395
|
operand,
|
|
327
|
-
PyLegendDayOfYearExpression.__to_sql_func
|
|
396
|
+
PyLegendDayOfYearExpression.__to_sql_func,
|
|
397
|
+
PyLegendDayOfYearExpression.__to_pure_func
|
|
328
398
|
)
|
|
329
399
|
|
|
330
400
|
|
|
@@ -338,12 +408,17 @@ class PyLegendDayOfMonthExpression(PyLegendUnaryExpression, PyLegendExpressionIn
|
|
|
338
408
|
) -> Expression:
|
|
339
409
|
return DayOfMonthExpression(expression)
|
|
340
410
|
|
|
411
|
+
@staticmethod
|
|
412
|
+
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
413
|
+
return generate_pure_functional_call("dayOfMonth", [op_expr], auto_map=True)
|
|
414
|
+
|
|
341
415
|
def __init__(self, operand: PyLegendExpressionDateReturn) -> None:
|
|
342
416
|
PyLegendExpressionIntegerReturn.__init__(self)
|
|
343
417
|
PyLegendUnaryExpression.__init__(
|
|
344
418
|
self,
|
|
345
419
|
operand,
|
|
346
|
-
PyLegendDayOfMonthExpression.__to_sql_func
|
|
420
|
+
PyLegendDayOfMonthExpression.__to_sql_func,
|
|
421
|
+
PyLegendDayOfMonthExpression.__to_pure_func
|
|
347
422
|
)
|
|
348
423
|
|
|
349
424
|
|
|
@@ -357,12 +432,17 @@ class PyLegendDayOfWeekExpression(PyLegendUnaryExpression, PyLegendExpressionInt
|
|
|
357
432
|
) -> Expression:
|
|
358
433
|
return DayOfWeekExpression(expression)
|
|
359
434
|
|
|
435
|
+
@staticmethod
|
|
436
|
+
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
437
|
+
return generate_pure_functional_call("dayOfWeekNumber", [op_expr], auto_map=True)
|
|
438
|
+
|
|
360
439
|
def __init__(self, operand: PyLegendExpressionDateReturn) -> None:
|
|
361
440
|
PyLegendExpressionIntegerReturn.__init__(self)
|
|
362
441
|
PyLegendUnaryExpression.__init__(
|
|
363
442
|
self,
|
|
364
443
|
operand,
|
|
365
|
-
PyLegendDayOfWeekExpression.__to_sql_func
|
|
444
|
+
PyLegendDayOfWeekExpression.__to_sql_func,
|
|
445
|
+
PyLegendDayOfWeekExpression.__to_pure_func
|
|
366
446
|
)
|
|
367
447
|
|
|
368
448
|
|
|
@@ -376,12 +456,17 @@ class PyLegendHourExpression(PyLegendUnaryExpression, PyLegendExpressionIntegerR
|
|
|
376
456
|
) -> Expression:
|
|
377
457
|
return HourExpression(expression)
|
|
378
458
|
|
|
459
|
+
@staticmethod
|
|
460
|
+
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
461
|
+
return generate_pure_functional_call("hour", [op_expr], auto_map=True)
|
|
462
|
+
|
|
379
463
|
def __init__(self, operand: PyLegendExpressionDateReturn) -> None:
|
|
380
464
|
PyLegendExpressionIntegerReturn.__init__(self)
|
|
381
465
|
PyLegendUnaryExpression.__init__(
|
|
382
466
|
self,
|
|
383
467
|
operand,
|
|
384
|
-
PyLegendHourExpression.__to_sql_func
|
|
468
|
+
PyLegendHourExpression.__to_sql_func,
|
|
469
|
+
PyLegendHourExpression.__to_pure_func
|
|
385
470
|
)
|
|
386
471
|
|
|
387
472
|
|
|
@@ -395,12 +480,17 @@ class PyLegendMinuteExpression(PyLegendUnaryExpression, PyLegendExpressionIntege
|
|
|
395
480
|
) -> Expression:
|
|
396
481
|
return MinuteExpression(expression)
|
|
397
482
|
|
|
483
|
+
@staticmethod
|
|
484
|
+
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
485
|
+
return generate_pure_functional_call("minute", [op_expr], auto_map=True)
|
|
486
|
+
|
|
398
487
|
def __init__(self, operand: PyLegendExpressionDateReturn) -> None:
|
|
399
488
|
PyLegendExpressionIntegerReturn.__init__(self)
|
|
400
489
|
PyLegendUnaryExpression.__init__(
|
|
401
490
|
self,
|
|
402
491
|
operand,
|
|
403
|
-
PyLegendMinuteExpression.__to_sql_func
|
|
492
|
+
PyLegendMinuteExpression.__to_sql_func,
|
|
493
|
+
PyLegendMinuteExpression.__to_pure_func
|
|
404
494
|
)
|
|
405
495
|
|
|
406
496
|
|
|
@@ -414,12 +504,17 @@ class PyLegendSecondExpression(PyLegendUnaryExpression, PyLegendExpressionIntege
|
|
|
414
504
|
) -> Expression:
|
|
415
505
|
return SecondExpression(expression)
|
|
416
506
|
|
|
507
|
+
@staticmethod
|
|
508
|
+
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
509
|
+
return generate_pure_functional_call("second", [op_expr], auto_map=True)
|
|
510
|
+
|
|
417
511
|
def __init__(self, operand: PyLegendExpressionDateReturn) -> None:
|
|
418
512
|
PyLegendExpressionIntegerReturn.__init__(self)
|
|
419
513
|
PyLegendUnaryExpression.__init__(
|
|
420
514
|
self,
|
|
421
515
|
operand,
|
|
422
|
-
PyLegendSecondExpression.__to_sql_func
|
|
516
|
+
PyLegendSecondExpression.__to_sql_func,
|
|
517
|
+
PyLegendSecondExpression.__to_pure_func
|
|
423
518
|
)
|
|
424
519
|
|
|
425
520
|
|
|
@@ -433,12 +528,17 @@ class PyLegendEpochExpression(PyLegendUnaryExpression, PyLegendExpressionInteger
|
|
|
433
528
|
) -> Expression:
|
|
434
529
|
return EpochExpression(expression)
|
|
435
530
|
|
|
531
|
+
@staticmethod
|
|
532
|
+
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
533
|
+
return generate_pure_functional_call("toEpochValue", [op_expr], auto_map=True)
|
|
534
|
+
|
|
436
535
|
def __init__(self, operand: PyLegendExpressionDateReturn) -> None:
|
|
437
536
|
PyLegendExpressionIntegerReturn.__init__(self)
|
|
438
537
|
PyLegendUnaryExpression.__init__(
|
|
439
538
|
self,
|
|
440
539
|
operand,
|
|
441
|
-
PyLegendEpochExpression.__to_sql_func
|
|
540
|
+
PyLegendEpochExpression.__to_sql_func,
|
|
541
|
+
PyLegendEpochExpression.__to_pure_func
|
|
442
542
|
)
|
|
443
543
|
|
|
444
544
|
|
|
@@ -451,11 +551,16 @@ class PyLegendTodayExpression(PyLegendNullaryExpression, PyLegendExpressionStric
|
|
|
451
551
|
) -> Expression:
|
|
452
552
|
return CurrentTime(type_=CurrentTimeType.DATE, precision=None)
|
|
453
553
|
|
|
554
|
+
@staticmethod
|
|
555
|
+
def __to_pure_func(config: FrameToPureConfig) -> str:
|
|
556
|
+
return "today()"
|
|
557
|
+
|
|
454
558
|
def __init__(self) -> None:
|
|
455
559
|
PyLegendExpressionStrictDateReturn.__init__(self)
|
|
456
560
|
PyLegendNullaryExpression.__init__(
|
|
457
561
|
self,
|
|
458
|
-
PyLegendTodayExpression.__to_sql_func
|
|
562
|
+
PyLegendTodayExpression.__to_sql_func,
|
|
563
|
+
PyLegendTodayExpression.__to_pure_func
|
|
459
564
|
)
|
|
460
565
|
|
|
461
566
|
|
|
@@ -468,9 +573,44 @@ class PyLegendNowExpression(PyLegendNullaryExpression, PyLegendExpressionDateTim
|
|
|
468
573
|
) -> Expression:
|
|
469
574
|
return CurrentTime(type_=CurrentTimeType.TIMESTAMP, precision=None)
|
|
470
575
|
|
|
576
|
+
@staticmethod
|
|
577
|
+
def __to_pure_func(config: FrameToPureConfig) -> str:
|
|
578
|
+
return "now()"
|
|
579
|
+
|
|
471
580
|
def __init__(self) -> None:
|
|
472
581
|
PyLegendExpressionDateTimeReturn.__init__(self)
|
|
473
582
|
PyLegendNullaryExpression.__init__(
|
|
474
583
|
self,
|
|
475
|
-
PyLegendNowExpression.__to_sql_func
|
|
584
|
+
PyLegendNowExpression.__to_sql_func,
|
|
585
|
+
PyLegendNowExpression.__to_pure_func
|
|
586
|
+
)
|
|
587
|
+
|
|
588
|
+
|
|
589
|
+
class PyLegendDatePartExpression(PyLegendUnaryExpression, PyLegendExpressionStrictDateReturn):
|
|
590
|
+
|
|
591
|
+
@staticmethod
|
|
592
|
+
def __to_sql_func(
|
|
593
|
+
expression: Expression,
|
|
594
|
+
frame_name_to_base_query_map: PyLegendDict[str, QuerySpecification],
|
|
595
|
+
config: FrameToSqlConfig
|
|
596
|
+
) -> Expression:
|
|
597
|
+
return Cast(expression, ColumnType(name="DATE", parameters=[]))
|
|
598
|
+
|
|
599
|
+
@staticmethod
|
|
600
|
+
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
601
|
+
return generate_pure_functional_call(
|
|
602
|
+
"cast",
|
|
603
|
+
[
|
|
604
|
+
generate_pure_functional_call("datePart", [op_expr], auto_map=True),
|
|
605
|
+
"@StrictDate",
|
|
606
|
+
]
|
|
607
|
+
)
|
|
608
|
+
|
|
609
|
+
def __init__(self, operand: PyLegendExpressionDateReturn) -> None:
|
|
610
|
+
PyLegendExpressionStrictDateReturn.__init__(self)
|
|
611
|
+
PyLegendUnaryExpression.__init__(
|
|
612
|
+
self,
|
|
613
|
+
operand,
|
|
614
|
+
PyLegendDatePartExpression.__to_sql_func,
|
|
615
|
+
PyLegendDatePartExpression.__to_pure_func
|
|
476
616
|
)
|
|
@@ -16,11 +16,12 @@ 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
|
PyLegendExpressionFloatReturn,
|
|
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
|
+
from pylegend.core.language.shared.helpers import generate_pure_functional_call
|
|
24
25
|
from pylegend.core.sql.metamodel import (
|
|
25
26
|
Expression,
|
|
26
27
|
QuerySpecification,
|
|
@@ -32,6 +33,7 @@ from pylegend.core.sql.metamodel_extension import (
|
|
|
32
33
|
AbsoluteExpression,
|
|
33
34
|
)
|
|
34
35
|
from pylegend.core.tds.tds_frame import FrameToSqlConfig
|
|
36
|
+
from pylegend.core.tds.tds_frame import FrameToPureConfig
|
|
35
37
|
|
|
36
38
|
|
|
37
39
|
__all__: PyLegendSequence[str] = [
|
|
@@ -54,15 +56,26 @@ class PyLegendFloatAddExpression(PyLegendBinaryExpression, PyLegendExpressionFlo
|
|
|
54
56
|
) -> Expression:
|
|
55
57
|
return ArithmeticExpression(ArithmeticType.ADD, expression1, expression2)
|
|
56
58
|
|
|
59
|
+
@staticmethod
|
|
60
|
+
def __to_pure_func(op1_expr: str, op2_expr: str, config: FrameToPureConfig) -> str:
|
|
61
|
+
return f"({op1_expr} + {op2_expr})"
|
|
62
|
+
|
|
57
63
|
def __init__(self, operand1: PyLegendExpressionFloatReturn, operand2: PyLegendExpressionFloatReturn) -> None:
|
|
58
64
|
PyLegendExpressionFloatReturn.__init__(self)
|
|
59
65
|
PyLegendBinaryExpression.__init__(
|
|
60
66
|
self,
|
|
61
67
|
operand1,
|
|
62
68
|
operand2,
|
|
63
|
-
PyLegendFloatAddExpression.__to_sql_func
|
|
69
|
+
PyLegendFloatAddExpression.__to_sql_func,
|
|
70
|
+
PyLegendFloatAddExpression.__to_pure_func
|
|
64
71
|
)
|
|
65
72
|
|
|
73
|
+
def is_non_nullable(self) -> bool:
|
|
74
|
+
return True
|
|
75
|
+
|
|
76
|
+
def to_pure_expression(self, config: FrameToPureConfig) -> str:
|
|
77
|
+
return PyLegendBinaryExpression.to_pure_expression_with_to_one_on_both_operands(self, config)
|
|
78
|
+
|
|
66
79
|
|
|
67
80
|
class PyLegendFloatSubtractExpression(PyLegendBinaryExpression, PyLegendExpressionFloatReturn):
|
|
68
81
|
|
|
@@ -75,15 +88,26 @@ class PyLegendFloatSubtractExpression(PyLegendBinaryExpression, PyLegendExpressi
|
|
|
75
88
|
) -> Expression:
|
|
76
89
|
return ArithmeticExpression(ArithmeticType.SUBTRACT, expression1, expression2)
|
|
77
90
|
|
|
91
|
+
@staticmethod
|
|
92
|
+
def __to_pure_func(op1_expr: str, op2_expr: str, config: FrameToPureConfig) -> str:
|
|
93
|
+
return f"({op1_expr} - {op2_expr})"
|
|
94
|
+
|
|
78
95
|
def __init__(self, operand1: PyLegendExpressionFloatReturn, operand2: PyLegendExpressionFloatReturn) -> None:
|
|
79
96
|
PyLegendExpressionFloatReturn.__init__(self)
|
|
80
97
|
PyLegendBinaryExpression.__init__(
|
|
81
98
|
self,
|
|
82
99
|
operand1,
|
|
83
100
|
operand2,
|
|
84
|
-
PyLegendFloatSubtractExpression.__to_sql_func
|
|
101
|
+
PyLegendFloatSubtractExpression.__to_sql_func,
|
|
102
|
+
PyLegendFloatSubtractExpression.__to_pure_func
|
|
85
103
|
)
|
|
86
104
|
|
|
105
|
+
def is_non_nullable(self) -> bool:
|
|
106
|
+
return True
|
|
107
|
+
|
|
108
|
+
def to_pure_expression(self, config: FrameToPureConfig) -> str:
|
|
109
|
+
return PyLegendBinaryExpression.to_pure_expression_with_to_one_on_both_operands(self, config)
|
|
110
|
+
|
|
87
111
|
|
|
88
112
|
class PyLegendFloatMultiplyExpression(PyLegendBinaryExpression, PyLegendExpressionFloatReturn):
|
|
89
113
|
|
|
@@ -96,15 +120,26 @@ class PyLegendFloatMultiplyExpression(PyLegendBinaryExpression, PyLegendExpressi
|
|
|
96
120
|
) -> Expression:
|
|
97
121
|
return ArithmeticExpression(ArithmeticType.MULTIPLY, expression1, expression2)
|
|
98
122
|
|
|
123
|
+
@staticmethod
|
|
124
|
+
def __to_pure_func(op1_expr: str, op2_expr: str, config: FrameToPureConfig) -> str:
|
|
125
|
+
return f"({op1_expr} * {op2_expr})"
|
|
126
|
+
|
|
99
127
|
def __init__(self, operand1: PyLegendExpressionFloatReturn, operand2: PyLegendExpressionFloatReturn) -> None:
|
|
100
128
|
PyLegendExpressionFloatReturn.__init__(self)
|
|
101
129
|
PyLegendBinaryExpression.__init__(
|
|
102
130
|
self,
|
|
103
131
|
operand1,
|
|
104
132
|
operand2,
|
|
105
|
-
PyLegendFloatMultiplyExpression.__to_sql_func
|
|
133
|
+
PyLegendFloatMultiplyExpression.__to_sql_func,
|
|
134
|
+
PyLegendFloatMultiplyExpression.__to_pure_func
|
|
106
135
|
)
|
|
107
136
|
|
|
137
|
+
def is_non_nullable(self) -> bool:
|
|
138
|
+
return True
|
|
139
|
+
|
|
140
|
+
def to_pure_expression(self, config: FrameToPureConfig) -> str:
|
|
141
|
+
return PyLegendBinaryExpression.to_pure_expression_with_to_one_on_both_operands(self, config)
|
|
142
|
+
|
|
108
143
|
|
|
109
144
|
class PyLegendFloatAbsoluteExpression(PyLegendUnaryExpression, PyLegendExpressionFloatReturn):
|
|
110
145
|
|
|
@@ -116,12 +151,17 @@ class PyLegendFloatAbsoluteExpression(PyLegendUnaryExpression, PyLegendExpressio
|
|
|
116
151
|
) -> Expression:
|
|
117
152
|
return AbsoluteExpression(expression)
|
|
118
153
|
|
|
154
|
+
@staticmethod
|
|
155
|
+
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
156
|
+
return generate_pure_functional_call("abs", [op_expr], auto_map=True)
|
|
157
|
+
|
|
119
158
|
def __init__(self, operand: PyLegendExpressionFloatReturn) -> None:
|
|
120
159
|
PyLegendExpressionFloatReturn.__init__(self)
|
|
121
160
|
PyLegendUnaryExpression.__init__(
|
|
122
161
|
self,
|
|
123
162
|
operand,
|
|
124
|
-
PyLegendFloatAbsoluteExpression.__to_sql_func
|
|
163
|
+
PyLegendFloatAbsoluteExpression.__to_sql_func,
|
|
164
|
+
PyLegendFloatAbsoluteExpression.__to_pure_func
|
|
125
165
|
)
|
|
126
166
|
|
|
127
167
|
|
|
@@ -135,10 +175,15 @@ class PyLegendFloatNegativeExpression(PyLegendUnaryExpression, PyLegendExpressio
|
|
|
135
175
|
) -> Expression:
|
|
136
176
|
return NegativeExpression(expression)
|
|
137
177
|
|
|
178
|
+
@staticmethod
|
|
179
|
+
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
180
|
+
return generate_pure_functional_call("minus", [op_expr], auto_map=True)
|
|
181
|
+
|
|
138
182
|
def __init__(self, operand: PyLegendExpressionFloatReturn) -> None:
|
|
139
183
|
PyLegendExpressionFloatReturn.__init__(self)
|
|
140
184
|
PyLegendUnaryExpression.__init__(
|
|
141
185
|
self,
|
|
142
186
|
operand,
|
|
143
|
-
PyLegendFloatNegativeExpression.__to_sql_func
|
|
187
|
+
PyLegendFloatNegativeExpression.__to_sql_func,
|
|
188
|
+
PyLegendFloatNegativeExpression.__to_pure_func
|
|
144
189
|
)
|