pylegend 0.5.0__py3-none-any.whl → 0.7.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 -0
- pylegend/core/language/shared/helpers.py +1 -9
- pylegend/core/language/shared/operations/binary_expression.py +22 -22
- pylegend/core/language/shared/operations/boolean_operation_expressions.py +13 -16
- pylegend/core/language/shared/operations/date_operation_expressions.py +84 -42
- pylegend/core/language/shared/operations/float_operation_expressions.py +20 -25
- pylegend/core/language/shared/operations/integer_operation_expressions.py +25 -30
- pylegend/core/language/shared/operations/nullary_expression.py +6 -1
- pylegend/core/language/shared/operations/number_operation_expressions.py +109 -90
- pylegend/core/language/shared/operations/primitive_operation_expressions.py +8 -16
- pylegend/core/language/shared/operations/string_operation_expressions.py +43 -26
- pylegend/core/language/shared/operations/unary_expression.py +16 -1
- pylegend/core/tds/legendql_api/frames/functions/legendql_api_window_extend_function.py +1 -1
- pylegend/extensions/tds/legendql_api/frames/legendql_api_legend_function_input_frame.py +46 -0
- pylegend/legendql_api_tds_client.py +73 -0
- {pylegend-0.5.0.dist-info → pylegend-0.7.0.dist-info}/METADATA +5 -2
- {pylegend-0.5.0.dist-info → pylegend-0.7.0.dist-info}/RECORD +21 -19
- {pylegend-0.5.0.dist-info → pylegend-0.7.0.dist-info}/WHEEL +1 -1
- {pylegend-0.5.0.dist-info → pylegend-0.7.0.dist-info/licenses}/LICENSE +0 -0
- {pylegend-0.5.0.dist-info → pylegend-0.7.0.dist-info/licenses}/LICENSE.spdx +0 -0
- {pylegend-0.5.0.dist-info → pylegend-0.7.0.dist-info/licenses}/NOTICE +0 -0
|
@@ -68,15 +68,12 @@ class PyLegendIntegerAddExpression(PyLegendBinaryExpression, PyLegendExpressionI
|
|
|
68
68
|
operand1,
|
|
69
69
|
operand2,
|
|
70
70
|
PyLegendIntegerAddExpression.__to_sql_func,
|
|
71
|
-
PyLegendIntegerAddExpression.__to_pure_func
|
|
71
|
+
PyLegendIntegerAddExpression.__to_pure_func,
|
|
72
|
+
non_nullable=True,
|
|
73
|
+
first_operand_needs_to_be_non_nullable=True,
|
|
74
|
+
second_operand_needs_to_be_non_nullable=True
|
|
72
75
|
)
|
|
73
76
|
|
|
74
|
-
def is_non_nullable(self) -> bool:
|
|
75
|
-
return True
|
|
76
|
-
|
|
77
|
-
def to_pure_expression(self, config: FrameToPureConfig) -> str:
|
|
78
|
-
return PyLegendBinaryExpression.to_pure_expression_with_to_one_on_both_operands(self, config)
|
|
79
|
-
|
|
80
77
|
|
|
81
78
|
class PyLegendIntegerSubtractExpression(PyLegendBinaryExpression, PyLegendExpressionIntegerReturn):
|
|
82
79
|
|
|
@@ -100,15 +97,12 @@ class PyLegendIntegerSubtractExpression(PyLegendBinaryExpression, PyLegendExpres
|
|
|
100
97
|
operand1,
|
|
101
98
|
operand2,
|
|
102
99
|
PyLegendIntegerSubtractExpression.__to_sql_func,
|
|
103
|
-
PyLegendIntegerSubtractExpression.__to_pure_func
|
|
100
|
+
PyLegendIntegerSubtractExpression.__to_pure_func,
|
|
101
|
+
non_nullable=True,
|
|
102
|
+
first_operand_needs_to_be_non_nullable=True,
|
|
103
|
+
second_operand_needs_to_be_non_nullable=True
|
|
104
104
|
)
|
|
105
105
|
|
|
106
|
-
def is_non_nullable(self) -> bool:
|
|
107
|
-
return True
|
|
108
|
-
|
|
109
|
-
def to_pure_expression(self, config: FrameToPureConfig) -> str:
|
|
110
|
-
return PyLegendBinaryExpression.to_pure_expression_with_to_one_on_both_operands(self, config)
|
|
111
|
-
|
|
112
106
|
|
|
113
107
|
class PyLegendIntegerMultiplyExpression(PyLegendBinaryExpression, PyLegendExpressionIntegerReturn):
|
|
114
108
|
|
|
@@ -132,15 +126,12 @@ class PyLegendIntegerMultiplyExpression(PyLegendBinaryExpression, PyLegendExpres
|
|
|
132
126
|
operand1,
|
|
133
127
|
operand2,
|
|
134
128
|
PyLegendIntegerMultiplyExpression.__to_sql_func,
|
|
135
|
-
PyLegendIntegerMultiplyExpression.__to_pure_func
|
|
129
|
+
PyLegendIntegerMultiplyExpression.__to_pure_func,
|
|
130
|
+
non_nullable=True,
|
|
131
|
+
first_operand_needs_to_be_non_nullable=True,
|
|
132
|
+
second_operand_needs_to_be_non_nullable=True
|
|
136
133
|
)
|
|
137
134
|
|
|
138
|
-
def is_non_nullable(self) -> bool:
|
|
139
|
-
return True
|
|
140
|
-
|
|
141
|
-
def to_pure_expression(self, config: FrameToPureConfig) -> str:
|
|
142
|
-
return PyLegendBinaryExpression.to_pure_expression_with_to_one_on_both_operands(self, config)
|
|
143
|
-
|
|
144
135
|
|
|
145
136
|
class PyLegendIntegerModuloExpression(PyLegendBinaryExpression, PyLegendExpressionIntegerReturn):
|
|
146
137
|
|
|
@@ -155,7 +146,7 @@ class PyLegendIntegerModuloExpression(PyLegendBinaryExpression, PyLegendExpressi
|
|
|
155
146
|
|
|
156
147
|
@staticmethod
|
|
157
148
|
def __to_pure_func(op1_expr: str, op2_expr: str, config: FrameToPureConfig) -> str:
|
|
158
|
-
return generate_pure_functional_call("mod", [op1_expr, op2_expr]
|
|
149
|
+
return generate_pure_functional_call("mod", [op1_expr, op2_expr])
|
|
159
150
|
|
|
160
151
|
def __init__(self, operand1: PyLegendExpressionIntegerReturn, operand2: PyLegendExpressionIntegerReturn) -> None:
|
|
161
152
|
PyLegendExpressionIntegerReturn.__init__(self)
|
|
@@ -164,12 +155,12 @@ class PyLegendIntegerModuloExpression(PyLegendBinaryExpression, PyLegendExpressi
|
|
|
164
155
|
operand1,
|
|
165
156
|
operand2,
|
|
166
157
|
PyLegendIntegerModuloExpression.__to_sql_func,
|
|
167
|
-
PyLegendIntegerModuloExpression.__to_pure_func
|
|
158
|
+
PyLegendIntegerModuloExpression.__to_pure_func,
|
|
159
|
+
non_nullable=True,
|
|
160
|
+
first_operand_needs_to_be_non_nullable=True,
|
|
161
|
+
second_operand_needs_to_be_non_nullable=True
|
|
168
162
|
)
|
|
169
163
|
|
|
170
|
-
def to_pure_expression(self, config: FrameToPureConfig) -> str:
|
|
171
|
-
return PyLegendBinaryExpression.to_pure_expression_with_to_one_on_second_operand(self, config)
|
|
172
|
-
|
|
173
164
|
|
|
174
165
|
class PyLegendIntegerAbsoluteExpression(PyLegendUnaryExpression, PyLegendExpressionIntegerReturn):
|
|
175
166
|
|
|
@@ -183,7 +174,7 @@ class PyLegendIntegerAbsoluteExpression(PyLegendUnaryExpression, PyLegendExpress
|
|
|
183
174
|
|
|
184
175
|
@staticmethod
|
|
185
176
|
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
186
|
-
return generate_pure_functional_call("abs", [op_expr]
|
|
177
|
+
return generate_pure_functional_call("abs", [op_expr])
|
|
187
178
|
|
|
188
179
|
def __init__(self, operand: PyLegendExpressionIntegerReturn) -> None:
|
|
189
180
|
PyLegendExpressionIntegerReturn.__init__(self)
|
|
@@ -191,7 +182,9 @@ class PyLegendIntegerAbsoluteExpression(PyLegendUnaryExpression, PyLegendExpress
|
|
|
191
182
|
self,
|
|
192
183
|
operand,
|
|
193
184
|
PyLegendIntegerAbsoluteExpression.__to_sql_func,
|
|
194
|
-
PyLegendIntegerAbsoluteExpression.__to_pure_func
|
|
185
|
+
PyLegendIntegerAbsoluteExpression.__to_pure_func,
|
|
186
|
+
non_nullable=True,
|
|
187
|
+
operand_needs_to_be_non_nullable=True,
|
|
195
188
|
)
|
|
196
189
|
|
|
197
190
|
|
|
@@ -207,7 +200,7 @@ class PyLegendIntegerNegativeExpression(PyLegendUnaryExpression, PyLegendExpress
|
|
|
207
200
|
|
|
208
201
|
@staticmethod
|
|
209
202
|
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
210
|
-
return generate_pure_functional_call("minus", [op_expr]
|
|
203
|
+
return generate_pure_functional_call("minus", [op_expr])
|
|
211
204
|
|
|
212
205
|
def __init__(self, operand: PyLegendExpressionIntegerReturn) -> None:
|
|
213
206
|
PyLegendExpressionIntegerReturn.__init__(self)
|
|
@@ -215,5 +208,7 @@ class PyLegendIntegerNegativeExpression(PyLegendUnaryExpression, PyLegendExpress
|
|
|
215
208
|
self,
|
|
216
209
|
operand,
|
|
217
210
|
PyLegendIntegerNegativeExpression.__to_sql_func,
|
|
218
|
-
PyLegendIntegerNegativeExpression.__to_pure_func
|
|
211
|
+
PyLegendIntegerNegativeExpression.__to_pure_func,
|
|
212
|
+
non_nullable=True,
|
|
213
|
+
operand_needs_to_be_non_nullable=True,
|
|
219
214
|
)
|
|
@@ -47,10 +47,12 @@ class PyLegendNullaryExpression(PyLegendExpression, metaclass=ABCMeta):
|
|
|
47
47
|
[PyLegendDict[str, QuerySpecification], FrameToSqlConfig],
|
|
48
48
|
Expression
|
|
49
49
|
],
|
|
50
|
-
to_pure_func: PyLegendCallable[[FrameToPureConfig], str]
|
|
50
|
+
to_pure_func: PyLegendCallable[[FrameToPureConfig], str],
|
|
51
|
+
non_nullable: bool = False,
|
|
51
52
|
) -> None:
|
|
52
53
|
self.__to_sql_func = to_sql_func
|
|
53
54
|
self.__to_pure_func = to_pure_func
|
|
55
|
+
self.__non_nullable = non_nullable
|
|
54
56
|
|
|
55
57
|
def to_sql_expression(
|
|
56
58
|
self,
|
|
@@ -64,3 +66,6 @@ class PyLegendNullaryExpression(PyLegendExpression, metaclass=ABCMeta):
|
|
|
64
66
|
|
|
65
67
|
def to_pure_expression(self, config: FrameToPureConfig) -> str:
|
|
66
68
|
return self.__to_pure_func(config)
|
|
69
|
+
|
|
70
|
+
def is_non_nullable(self) -> bool:
|
|
71
|
+
return self.__non_nullable
|
|
@@ -110,15 +110,12 @@ class PyLegendNumberAddExpression(PyLegendBinaryExpression, PyLegendExpressionNu
|
|
|
110
110
|
operand1,
|
|
111
111
|
operand2,
|
|
112
112
|
PyLegendNumberAddExpression.__to_sql_func,
|
|
113
|
-
PyLegendNumberAddExpression.__to_pure_func
|
|
113
|
+
PyLegendNumberAddExpression.__to_pure_func,
|
|
114
|
+
non_nullable=True,
|
|
115
|
+
first_operand_needs_to_be_non_nullable=True,
|
|
116
|
+
second_operand_needs_to_be_non_nullable=True
|
|
114
117
|
)
|
|
115
118
|
|
|
116
|
-
def is_non_nullable(self) -> bool:
|
|
117
|
-
return True
|
|
118
|
-
|
|
119
|
-
def to_pure_expression(self, config: FrameToPureConfig) -> str:
|
|
120
|
-
return PyLegendBinaryExpression.to_pure_expression_with_to_one_on_both_operands(self, config)
|
|
121
|
-
|
|
122
119
|
|
|
123
120
|
class PyLegendNumberMultiplyExpression(PyLegendBinaryExpression, PyLegendExpressionNumberReturn):
|
|
124
121
|
|
|
@@ -142,15 +139,12 @@ class PyLegendNumberMultiplyExpression(PyLegendBinaryExpression, PyLegendExpress
|
|
|
142
139
|
operand1,
|
|
143
140
|
operand2,
|
|
144
141
|
PyLegendNumberMultiplyExpression.__to_sql_func,
|
|
145
|
-
PyLegendNumberMultiplyExpression.__to_pure_func
|
|
142
|
+
PyLegendNumberMultiplyExpression.__to_pure_func,
|
|
143
|
+
non_nullable=True,
|
|
144
|
+
first_operand_needs_to_be_non_nullable=True,
|
|
145
|
+
second_operand_needs_to_be_non_nullable=True
|
|
146
146
|
)
|
|
147
147
|
|
|
148
|
-
def is_non_nullable(self) -> bool:
|
|
149
|
-
return True
|
|
150
|
-
|
|
151
|
-
def to_pure_expression(self, config: FrameToPureConfig) -> str:
|
|
152
|
-
return PyLegendBinaryExpression.to_pure_expression_with_to_one_on_both_operands(self, config)
|
|
153
|
-
|
|
154
148
|
|
|
155
149
|
class PyLegendNumberDivideExpression(PyLegendBinaryExpression, PyLegendExpressionNumberReturn):
|
|
156
150
|
|
|
@@ -165,7 +159,7 @@ class PyLegendNumberDivideExpression(PyLegendBinaryExpression, PyLegendExpressio
|
|
|
165
159
|
|
|
166
160
|
@staticmethod
|
|
167
161
|
def __to_pure_func(op1_expr: str, op2_expr: str, config: FrameToPureConfig) -> str:
|
|
168
|
-
return f"{op1_expr}
|
|
162
|
+
return f"({op1_expr} / {op2_expr})"
|
|
169
163
|
|
|
170
164
|
def __init__(self, operand1: PyLegendExpressionNumberReturn, operand2: PyLegendExpressionNumberReturn) -> None:
|
|
171
165
|
PyLegendExpressionNumberReturn.__init__(self)
|
|
@@ -174,12 +168,12 @@ class PyLegendNumberDivideExpression(PyLegendBinaryExpression, PyLegendExpressio
|
|
|
174
168
|
operand1,
|
|
175
169
|
operand2,
|
|
176
170
|
PyLegendNumberDivideExpression.__to_sql_func,
|
|
177
|
-
PyLegendNumberDivideExpression.__to_pure_func
|
|
171
|
+
PyLegendNumberDivideExpression.__to_pure_func,
|
|
172
|
+
non_nullable=True,
|
|
173
|
+
first_operand_needs_to_be_non_nullable=True,
|
|
174
|
+
second_operand_needs_to_be_non_nullable=True
|
|
178
175
|
)
|
|
179
176
|
|
|
180
|
-
def to_pure_expression(self, config: FrameToPureConfig) -> str:
|
|
181
|
-
return PyLegendBinaryExpression.to_pure_expression_with_to_one_on_second_operand(self, config)
|
|
182
|
-
|
|
183
177
|
|
|
184
178
|
class PyLegendNumberSubtractExpression(PyLegendBinaryExpression, PyLegendExpressionNumberReturn):
|
|
185
179
|
|
|
@@ -203,15 +197,12 @@ class PyLegendNumberSubtractExpression(PyLegendBinaryExpression, PyLegendExpress
|
|
|
203
197
|
operand1,
|
|
204
198
|
operand2,
|
|
205
199
|
PyLegendNumberSubtractExpression.__to_sql_func,
|
|
206
|
-
PyLegendNumberSubtractExpression.__to_pure_func
|
|
200
|
+
PyLegendNumberSubtractExpression.__to_pure_func,
|
|
201
|
+
non_nullable=True,
|
|
202
|
+
first_operand_needs_to_be_non_nullable=True,
|
|
203
|
+
second_operand_needs_to_be_non_nullable=True
|
|
207
204
|
)
|
|
208
205
|
|
|
209
|
-
def is_non_nullable(self) -> bool:
|
|
210
|
-
return True
|
|
211
|
-
|
|
212
|
-
def to_pure_expression(self, config: FrameToPureConfig) -> str:
|
|
213
|
-
return PyLegendBinaryExpression.to_pure_expression_with_to_one_on_both_operands(self, config)
|
|
214
|
-
|
|
215
206
|
|
|
216
207
|
class PyLegendNumberLessThanExpression(PyLegendBinaryExpression, PyLegendExpressionBooleanReturn):
|
|
217
208
|
|
|
@@ -235,12 +226,10 @@ class PyLegendNumberLessThanExpression(PyLegendBinaryExpression, PyLegendExpress
|
|
|
235
226
|
operand1,
|
|
236
227
|
operand2,
|
|
237
228
|
PyLegendNumberLessThanExpression.__to_sql_func,
|
|
238
|
-
PyLegendNumberLessThanExpression.__to_pure_func
|
|
229
|
+
PyLegendNumberLessThanExpression.__to_pure_func,
|
|
230
|
+
non_nullable=True,
|
|
239
231
|
)
|
|
240
232
|
|
|
241
|
-
def is_non_nullable(self) -> bool:
|
|
242
|
-
return True
|
|
243
|
-
|
|
244
233
|
|
|
245
234
|
class PyLegendNumberLessThanEqualExpression(PyLegendBinaryExpression, PyLegendExpressionBooleanReturn):
|
|
246
235
|
|
|
@@ -264,12 +253,10 @@ class PyLegendNumberLessThanEqualExpression(PyLegendBinaryExpression, PyLegendEx
|
|
|
264
253
|
operand1,
|
|
265
254
|
operand2,
|
|
266
255
|
PyLegendNumberLessThanEqualExpression.__to_sql_func,
|
|
267
|
-
PyLegendNumberLessThanEqualExpression.__to_pure_func
|
|
256
|
+
PyLegendNumberLessThanEqualExpression.__to_pure_func,
|
|
257
|
+
non_nullable=True,
|
|
268
258
|
)
|
|
269
259
|
|
|
270
|
-
def is_non_nullable(self) -> bool:
|
|
271
|
-
return True
|
|
272
|
-
|
|
273
260
|
|
|
274
261
|
class PyLegendNumberGreaterThanExpression(PyLegendBinaryExpression, PyLegendExpressionBooleanReturn):
|
|
275
262
|
|
|
@@ -293,12 +280,10 @@ class PyLegendNumberGreaterThanExpression(PyLegendBinaryExpression, PyLegendExpr
|
|
|
293
280
|
operand1,
|
|
294
281
|
operand2,
|
|
295
282
|
PyLegendNumberGreaterThanExpression.__to_sql_func,
|
|
296
|
-
PyLegendNumberGreaterThanExpression.__to_pure_func
|
|
283
|
+
PyLegendNumberGreaterThanExpression.__to_pure_func,
|
|
284
|
+
non_nullable=True,
|
|
297
285
|
)
|
|
298
286
|
|
|
299
|
-
def is_non_nullable(self) -> bool:
|
|
300
|
-
return True
|
|
301
|
-
|
|
302
287
|
|
|
303
288
|
class PyLegendNumberGreaterThanEqualExpression(PyLegendBinaryExpression, PyLegendExpressionBooleanReturn):
|
|
304
289
|
|
|
@@ -322,12 +307,10 @@ class PyLegendNumberGreaterThanEqualExpression(PyLegendBinaryExpression, PyLegen
|
|
|
322
307
|
operand1,
|
|
323
308
|
operand2,
|
|
324
309
|
PyLegendNumberGreaterThanEqualExpression.__to_sql_func,
|
|
325
|
-
PyLegendNumberGreaterThanEqualExpression.__to_pure_func
|
|
310
|
+
PyLegendNumberGreaterThanEqualExpression.__to_pure_func,
|
|
311
|
+
non_nullable=True,
|
|
326
312
|
)
|
|
327
313
|
|
|
328
|
-
def is_non_nullable(self) -> bool:
|
|
329
|
-
return True
|
|
330
|
-
|
|
331
314
|
|
|
332
315
|
class PyLegendNumberNegativeExpression(PyLegendUnaryExpression, PyLegendExpressionNumberReturn):
|
|
333
316
|
|
|
@@ -341,7 +324,7 @@ class PyLegendNumberNegativeExpression(PyLegendUnaryExpression, PyLegendExpressi
|
|
|
341
324
|
|
|
342
325
|
@staticmethod
|
|
343
326
|
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
344
|
-
return generate_pure_functional_call("minus", [op_expr]
|
|
327
|
+
return generate_pure_functional_call("minus", [op_expr])
|
|
345
328
|
|
|
346
329
|
def __init__(self, operand: PyLegendExpressionNumberReturn) -> None:
|
|
347
330
|
PyLegendExpressionNumberReturn.__init__(self)
|
|
@@ -349,7 +332,9 @@ class PyLegendNumberNegativeExpression(PyLegendUnaryExpression, PyLegendExpressi
|
|
|
349
332
|
self,
|
|
350
333
|
operand,
|
|
351
334
|
PyLegendNumberNegativeExpression.__to_sql_func,
|
|
352
|
-
PyLegendNumberNegativeExpression.__to_pure_func
|
|
335
|
+
PyLegendNumberNegativeExpression.__to_pure_func,
|
|
336
|
+
non_nullable=True,
|
|
337
|
+
operand_needs_to_be_non_nullable=True,
|
|
353
338
|
)
|
|
354
339
|
|
|
355
340
|
|
|
@@ -365,7 +350,7 @@ class PyLegendNumberAbsoluteExpression(PyLegendUnaryExpression, PyLegendExpressi
|
|
|
365
350
|
|
|
366
351
|
@staticmethod
|
|
367
352
|
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
368
|
-
return generate_pure_functional_call("abs", [op_expr]
|
|
353
|
+
return generate_pure_functional_call("abs", [op_expr])
|
|
369
354
|
|
|
370
355
|
def __init__(self, operand: PyLegendExpressionNumberReturn) -> None:
|
|
371
356
|
PyLegendExpressionNumberReturn.__init__(self)
|
|
@@ -373,7 +358,9 @@ class PyLegendNumberAbsoluteExpression(PyLegendUnaryExpression, PyLegendExpressi
|
|
|
373
358
|
self,
|
|
374
359
|
operand,
|
|
375
360
|
PyLegendNumberAbsoluteExpression.__to_sql_func,
|
|
376
|
-
PyLegendNumberAbsoluteExpression.__to_pure_func
|
|
361
|
+
PyLegendNumberAbsoluteExpression.__to_pure_func,
|
|
362
|
+
non_nullable=True,
|
|
363
|
+
operand_needs_to_be_non_nullable=True,
|
|
377
364
|
)
|
|
378
365
|
|
|
379
366
|
|
|
@@ -390,7 +377,7 @@ class PyLegendNumberPowerExpression(PyLegendBinaryExpression, PyLegendExpression
|
|
|
390
377
|
|
|
391
378
|
@staticmethod
|
|
392
379
|
def __to_pure_func(op1_expr: str, op2_expr: str, config: FrameToPureConfig) -> str:
|
|
393
|
-
return generate_pure_functional_call("pow", [op1_expr, op2_expr]
|
|
380
|
+
return generate_pure_functional_call("pow", [op1_expr, op2_expr])
|
|
394
381
|
|
|
395
382
|
def __init__(self, operand1: PyLegendExpressionNumberReturn, operand2: PyLegendExpressionNumberReturn) -> None:
|
|
396
383
|
PyLegendExpressionNumberReturn.__init__(self)
|
|
@@ -399,12 +386,12 @@ class PyLegendNumberPowerExpression(PyLegendBinaryExpression, PyLegendExpression
|
|
|
399
386
|
operand1,
|
|
400
387
|
operand2,
|
|
401
388
|
PyLegendNumberPowerExpression.__to_sql_func,
|
|
402
|
-
PyLegendNumberPowerExpression.__to_pure_func
|
|
389
|
+
PyLegendNumberPowerExpression.__to_pure_func,
|
|
390
|
+
non_nullable=True,
|
|
391
|
+
first_operand_needs_to_be_non_nullable=True,
|
|
392
|
+
second_operand_needs_to_be_non_nullable=True
|
|
403
393
|
)
|
|
404
394
|
|
|
405
|
-
def to_pure_expression(self, config: FrameToPureConfig) -> str:
|
|
406
|
-
return PyLegendBinaryExpression.to_pure_expression_with_to_one_on_second_operand(self, config)
|
|
407
|
-
|
|
408
395
|
|
|
409
396
|
class PyLegendNumberCeilExpression(PyLegendUnaryExpression, PyLegendExpressionIntegerReturn):
|
|
410
397
|
|
|
@@ -418,7 +405,7 @@ class PyLegendNumberCeilExpression(PyLegendUnaryExpression, PyLegendExpressionIn
|
|
|
418
405
|
|
|
419
406
|
@staticmethod
|
|
420
407
|
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
421
|
-
return generate_pure_functional_call("ceiling", [op_expr]
|
|
408
|
+
return generate_pure_functional_call("ceiling", [op_expr])
|
|
422
409
|
|
|
423
410
|
def __init__(self, operand: PyLegendExpressionNumberReturn) -> None:
|
|
424
411
|
PyLegendExpressionIntegerReturn.__init__(self)
|
|
@@ -426,7 +413,9 @@ class PyLegendNumberCeilExpression(PyLegendUnaryExpression, PyLegendExpressionIn
|
|
|
426
413
|
self,
|
|
427
414
|
operand,
|
|
428
415
|
PyLegendNumberCeilExpression.__to_sql_func,
|
|
429
|
-
PyLegendNumberCeilExpression.__to_pure_func
|
|
416
|
+
PyLegendNumberCeilExpression.__to_pure_func,
|
|
417
|
+
non_nullable=True,
|
|
418
|
+
operand_needs_to_be_non_nullable=True,
|
|
430
419
|
)
|
|
431
420
|
|
|
432
421
|
|
|
@@ -442,7 +431,7 @@ class PyLegendNumberFloorExpression(PyLegendUnaryExpression, PyLegendExpressionI
|
|
|
442
431
|
|
|
443
432
|
@staticmethod
|
|
444
433
|
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
445
|
-
return generate_pure_functional_call("floor", [op_expr]
|
|
434
|
+
return generate_pure_functional_call("floor", [op_expr])
|
|
446
435
|
|
|
447
436
|
def __init__(self, operand: PyLegendExpressionNumberReturn) -> None:
|
|
448
437
|
PyLegendExpressionIntegerReturn.__init__(self)
|
|
@@ -450,7 +439,9 @@ class PyLegendNumberFloorExpression(PyLegendUnaryExpression, PyLegendExpressionI
|
|
|
450
439
|
self,
|
|
451
440
|
operand,
|
|
452
441
|
PyLegendNumberFloorExpression.__to_sql_func,
|
|
453
|
-
PyLegendNumberFloorExpression.__to_pure_func
|
|
442
|
+
PyLegendNumberFloorExpression.__to_pure_func,
|
|
443
|
+
non_nullable=True,
|
|
444
|
+
operand_needs_to_be_non_nullable=True,
|
|
454
445
|
)
|
|
455
446
|
|
|
456
447
|
|
|
@@ -466,7 +457,7 @@ class PyLegendNumberSqrtExpression(PyLegendUnaryExpression, PyLegendExpressionNu
|
|
|
466
457
|
|
|
467
458
|
@staticmethod
|
|
468
459
|
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
469
|
-
return generate_pure_functional_call("sqrt", [op_expr]
|
|
460
|
+
return generate_pure_functional_call("sqrt", [op_expr])
|
|
470
461
|
|
|
471
462
|
def __init__(self, operand: PyLegendExpressionNumberReturn) -> None:
|
|
472
463
|
PyLegendExpressionNumberReturn.__init__(self)
|
|
@@ -474,7 +465,9 @@ class PyLegendNumberSqrtExpression(PyLegendUnaryExpression, PyLegendExpressionNu
|
|
|
474
465
|
self,
|
|
475
466
|
operand,
|
|
476
467
|
PyLegendNumberSqrtExpression.__to_sql_func,
|
|
477
|
-
PyLegendNumberSqrtExpression.__to_pure_func
|
|
468
|
+
PyLegendNumberSqrtExpression.__to_pure_func,
|
|
469
|
+
non_nullable=True,
|
|
470
|
+
operand_needs_to_be_non_nullable=True,
|
|
478
471
|
)
|
|
479
472
|
|
|
480
473
|
|
|
@@ -490,7 +483,7 @@ class PyLegendNumberCbrtExpression(PyLegendUnaryExpression, PyLegendExpressionNu
|
|
|
490
483
|
|
|
491
484
|
@staticmethod
|
|
492
485
|
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
493
|
-
return generate_pure_functional_call("cbrt", [op_expr]
|
|
486
|
+
return generate_pure_functional_call("cbrt", [op_expr])
|
|
494
487
|
|
|
495
488
|
def __init__(self, operand: PyLegendExpressionNumberReturn) -> None:
|
|
496
489
|
PyLegendExpressionNumberReturn.__init__(self)
|
|
@@ -498,7 +491,9 @@ class PyLegendNumberCbrtExpression(PyLegendUnaryExpression, PyLegendExpressionNu
|
|
|
498
491
|
self,
|
|
499
492
|
operand,
|
|
500
493
|
PyLegendNumberCbrtExpression.__to_sql_func,
|
|
501
|
-
PyLegendNumberCbrtExpression.__to_pure_func
|
|
494
|
+
PyLegendNumberCbrtExpression.__to_pure_func,
|
|
495
|
+
non_nullable=True,
|
|
496
|
+
operand_needs_to_be_non_nullable=True,
|
|
502
497
|
)
|
|
503
498
|
|
|
504
499
|
|
|
@@ -514,7 +509,7 @@ class PyLegendNumberExpExpression(PyLegendUnaryExpression, PyLegendExpressionNum
|
|
|
514
509
|
|
|
515
510
|
@staticmethod
|
|
516
511
|
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
517
|
-
return generate_pure_functional_call("exp", [op_expr]
|
|
512
|
+
return generate_pure_functional_call("exp", [op_expr])
|
|
518
513
|
|
|
519
514
|
def __init__(self, operand: PyLegendExpressionNumberReturn) -> None:
|
|
520
515
|
PyLegendExpressionNumberReturn.__init__(self)
|
|
@@ -522,7 +517,9 @@ class PyLegendNumberExpExpression(PyLegendUnaryExpression, PyLegendExpressionNum
|
|
|
522
517
|
self,
|
|
523
518
|
operand,
|
|
524
519
|
PyLegendNumberExpExpression.__to_sql_func,
|
|
525
|
-
PyLegendNumberExpExpression.__to_pure_func
|
|
520
|
+
PyLegendNumberExpExpression.__to_pure_func,
|
|
521
|
+
non_nullable=True,
|
|
522
|
+
operand_needs_to_be_non_nullable=True,
|
|
526
523
|
)
|
|
527
524
|
|
|
528
525
|
|
|
@@ -538,7 +535,7 @@ class PyLegendNumberLogExpression(PyLegendUnaryExpression, PyLegendExpressionNum
|
|
|
538
535
|
|
|
539
536
|
@staticmethod
|
|
540
537
|
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
541
|
-
return generate_pure_functional_call("log", [op_expr]
|
|
538
|
+
return generate_pure_functional_call("log", [op_expr])
|
|
542
539
|
|
|
543
540
|
def __init__(self, operand: PyLegendExpressionNumberReturn) -> None:
|
|
544
541
|
PyLegendExpressionNumberReturn.__init__(self)
|
|
@@ -546,7 +543,9 @@ class PyLegendNumberLogExpression(PyLegendUnaryExpression, PyLegendExpressionNum
|
|
|
546
543
|
self,
|
|
547
544
|
operand,
|
|
548
545
|
PyLegendNumberLogExpression.__to_sql_func,
|
|
549
|
-
PyLegendNumberLogExpression.__to_pure_func
|
|
546
|
+
PyLegendNumberLogExpression.__to_pure_func,
|
|
547
|
+
non_nullable=True,
|
|
548
|
+
operand_needs_to_be_non_nullable=True,
|
|
550
549
|
)
|
|
551
550
|
|
|
552
551
|
|
|
@@ -563,7 +562,7 @@ class PyLegendNumberRemainderExpression(PyLegendBinaryExpression, PyLegendExpres
|
|
|
563
562
|
|
|
564
563
|
@staticmethod
|
|
565
564
|
def __to_pure_func(op1_expr: str, op2_expr: str, config: FrameToPureConfig) -> str:
|
|
566
|
-
return generate_pure_functional_call("rem", [op1_expr, op2_expr]
|
|
565
|
+
return generate_pure_functional_call("rem", [op1_expr, op2_expr])
|
|
567
566
|
|
|
568
567
|
def __init__(self, operand1: PyLegendExpressionNumberReturn, operand2: PyLegendExpressionNumberReturn) -> None:
|
|
569
568
|
PyLegendExpressionNumberReturn.__init__(self)
|
|
@@ -572,12 +571,12 @@ class PyLegendNumberRemainderExpression(PyLegendBinaryExpression, PyLegendExpres
|
|
|
572
571
|
operand1,
|
|
573
572
|
operand2,
|
|
574
573
|
PyLegendNumberRemainderExpression.__to_sql_func,
|
|
575
|
-
PyLegendNumberRemainderExpression.__to_pure_func
|
|
574
|
+
PyLegendNumberRemainderExpression.__to_pure_func,
|
|
575
|
+
non_nullable=True,
|
|
576
|
+
first_operand_needs_to_be_non_nullable=True,
|
|
577
|
+
second_operand_needs_to_be_non_nullable=True
|
|
576
578
|
)
|
|
577
579
|
|
|
578
|
-
def to_pure_expression(self, config: FrameToPureConfig) -> str:
|
|
579
|
-
return PyLegendBinaryExpression.to_pure_expression_with_to_one_on_second_operand(self, config)
|
|
580
|
-
|
|
581
580
|
|
|
582
581
|
class PyLegendNumberRoundExpression(PyLegendBinaryExpression, PyLegendExpressionNumberReturn):
|
|
583
582
|
|
|
@@ -593,8 +592,8 @@ class PyLegendNumberRoundExpression(PyLegendBinaryExpression, PyLegendExpression
|
|
|
593
592
|
@staticmethod
|
|
594
593
|
def __to_pure_func(op1_expr: str, op2_expr: str, config: FrameToPureConfig) -> str:
|
|
595
594
|
if op2_expr == "0":
|
|
596
|
-
return generate_pure_functional_call("round", [op1_expr]
|
|
597
|
-
return generate_pure_functional_call("round", [f"cast({op1_expr}, @Float)", op2_expr]
|
|
595
|
+
return generate_pure_functional_call("round", [op1_expr])
|
|
596
|
+
return generate_pure_functional_call("round", [f"cast({op1_expr}, @Float)", op2_expr])
|
|
598
597
|
|
|
599
598
|
def __init__(self, operand1: PyLegendExpressionNumberReturn, operand2: PyLegendExpressionIntegerReturn) -> None:
|
|
600
599
|
PyLegendExpressionNumberReturn.__init__(self)
|
|
@@ -603,9 +602,15 @@ class PyLegendNumberRoundExpression(PyLegendBinaryExpression, PyLegendExpression
|
|
|
603
602
|
operand1,
|
|
604
603
|
operand2,
|
|
605
604
|
PyLegendNumberRoundExpression.__to_sql_func,
|
|
606
|
-
PyLegendNumberRoundExpression.__to_pure_func
|
|
605
|
+
PyLegendNumberRoundExpression.__to_pure_func,
|
|
606
|
+
non_nullable=True,
|
|
607
|
+
first_operand_needs_to_be_non_nullable=True,
|
|
608
|
+
second_operand_needs_to_be_non_nullable=True
|
|
607
609
|
)
|
|
608
610
|
|
|
611
|
+
def is_non_nullable(self) -> bool:
|
|
612
|
+
return True
|
|
613
|
+
|
|
609
614
|
|
|
610
615
|
class PyLegendNumberSineExpression(PyLegendUnaryExpression, PyLegendExpressionNumberReturn):
|
|
611
616
|
|
|
@@ -619,7 +624,7 @@ class PyLegendNumberSineExpression(PyLegendUnaryExpression, PyLegendExpressionNu
|
|
|
619
624
|
|
|
620
625
|
@staticmethod
|
|
621
626
|
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
622
|
-
return generate_pure_functional_call("sin", [op_expr]
|
|
627
|
+
return generate_pure_functional_call("sin", [op_expr])
|
|
623
628
|
|
|
624
629
|
def __init__(self, operand: PyLegendExpressionNumberReturn) -> None:
|
|
625
630
|
PyLegendExpressionNumberReturn.__init__(self)
|
|
@@ -627,7 +632,9 @@ class PyLegendNumberSineExpression(PyLegendUnaryExpression, PyLegendExpressionNu
|
|
|
627
632
|
self,
|
|
628
633
|
operand,
|
|
629
634
|
PyLegendNumberSineExpression.__to_sql_func,
|
|
630
|
-
PyLegendNumberSineExpression.__to_pure_func
|
|
635
|
+
PyLegendNumberSineExpression.__to_pure_func,
|
|
636
|
+
non_nullable=True,
|
|
637
|
+
operand_needs_to_be_non_nullable=True,
|
|
631
638
|
)
|
|
632
639
|
|
|
633
640
|
|
|
@@ -643,7 +650,7 @@ class PyLegendNumberArcSineExpression(PyLegendUnaryExpression, PyLegendExpressio
|
|
|
643
650
|
|
|
644
651
|
@staticmethod
|
|
645
652
|
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
646
|
-
return generate_pure_functional_call("asin", [op_expr]
|
|
653
|
+
return generate_pure_functional_call("asin", [op_expr])
|
|
647
654
|
|
|
648
655
|
def __init__(self, operand: PyLegendExpressionNumberReturn) -> None:
|
|
649
656
|
PyLegendExpressionNumberReturn.__init__(self)
|
|
@@ -651,7 +658,9 @@ class PyLegendNumberArcSineExpression(PyLegendUnaryExpression, PyLegendExpressio
|
|
|
651
658
|
self,
|
|
652
659
|
operand,
|
|
653
660
|
PyLegendNumberArcSineExpression.__to_sql_func,
|
|
654
|
-
PyLegendNumberArcSineExpression.__to_pure_func
|
|
661
|
+
PyLegendNumberArcSineExpression.__to_pure_func,
|
|
662
|
+
non_nullable=True,
|
|
663
|
+
operand_needs_to_be_non_nullable=True,
|
|
655
664
|
)
|
|
656
665
|
|
|
657
666
|
|
|
@@ -667,7 +676,7 @@ class PyLegendNumberCosineExpression(PyLegendUnaryExpression, PyLegendExpression
|
|
|
667
676
|
|
|
668
677
|
@staticmethod
|
|
669
678
|
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
670
|
-
return generate_pure_functional_call("cos", [op_expr]
|
|
679
|
+
return generate_pure_functional_call("cos", [op_expr])
|
|
671
680
|
|
|
672
681
|
def __init__(self, operand: PyLegendExpressionNumberReturn) -> None:
|
|
673
682
|
PyLegendExpressionNumberReturn.__init__(self)
|
|
@@ -675,7 +684,9 @@ class PyLegendNumberCosineExpression(PyLegendUnaryExpression, PyLegendExpression
|
|
|
675
684
|
self,
|
|
676
685
|
operand,
|
|
677
686
|
PyLegendNumberCosineExpression.__to_sql_func,
|
|
678
|
-
PyLegendNumberCosineExpression.__to_pure_func
|
|
687
|
+
PyLegendNumberCosineExpression.__to_pure_func,
|
|
688
|
+
non_nullable=True,
|
|
689
|
+
operand_needs_to_be_non_nullable=True,
|
|
679
690
|
)
|
|
680
691
|
|
|
681
692
|
|
|
@@ -691,7 +702,7 @@ class PyLegendNumberArcCosineExpression(PyLegendUnaryExpression, PyLegendExpress
|
|
|
691
702
|
|
|
692
703
|
@staticmethod
|
|
693
704
|
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
694
|
-
return generate_pure_functional_call("acos", [op_expr]
|
|
705
|
+
return generate_pure_functional_call("acos", [op_expr])
|
|
695
706
|
|
|
696
707
|
def __init__(self, operand: PyLegendExpressionNumberReturn) -> None:
|
|
697
708
|
PyLegendExpressionNumberReturn.__init__(self)
|
|
@@ -699,7 +710,9 @@ class PyLegendNumberArcCosineExpression(PyLegendUnaryExpression, PyLegendExpress
|
|
|
699
710
|
self,
|
|
700
711
|
operand,
|
|
701
712
|
PyLegendNumberArcCosineExpression.__to_sql_func,
|
|
702
|
-
PyLegendNumberArcCosineExpression.__to_pure_func
|
|
713
|
+
PyLegendNumberArcCosineExpression.__to_pure_func,
|
|
714
|
+
non_nullable=True,
|
|
715
|
+
operand_needs_to_be_non_nullable=True,
|
|
703
716
|
)
|
|
704
717
|
|
|
705
718
|
|
|
@@ -715,7 +728,7 @@ class PyLegendNumberTanExpression(PyLegendUnaryExpression, PyLegendExpressionNum
|
|
|
715
728
|
|
|
716
729
|
@staticmethod
|
|
717
730
|
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
718
|
-
return generate_pure_functional_call("tan", [op_expr]
|
|
731
|
+
return generate_pure_functional_call("tan", [op_expr])
|
|
719
732
|
|
|
720
733
|
def __init__(self, operand: PyLegendExpressionNumberReturn) -> None:
|
|
721
734
|
PyLegendExpressionNumberReturn.__init__(self)
|
|
@@ -723,7 +736,9 @@ class PyLegendNumberTanExpression(PyLegendUnaryExpression, PyLegendExpressionNum
|
|
|
723
736
|
self,
|
|
724
737
|
operand,
|
|
725
738
|
PyLegendNumberTanExpression.__to_sql_func,
|
|
726
|
-
PyLegendNumberTanExpression.__to_pure_func
|
|
739
|
+
PyLegendNumberTanExpression.__to_pure_func,
|
|
740
|
+
non_nullable=True,
|
|
741
|
+
operand_needs_to_be_non_nullable=True,
|
|
727
742
|
)
|
|
728
743
|
|
|
729
744
|
|
|
@@ -739,7 +754,7 @@ class PyLegendNumberArcTanExpression(PyLegendUnaryExpression, PyLegendExpression
|
|
|
739
754
|
|
|
740
755
|
@staticmethod
|
|
741
756
|
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
742
|
-
return generate_pure_functional_call("atan", [op_expr]
|
|
757
|
+
return generate_pure_functional_call("atan", [op_expr])
|
|
743
758
|
|
|
744
759
|
def __init__(self, operand: PyLegendExpressionNumberReturn) -> None:
|
|
745
760
|
PyLegendExpressionNumberReturn.__init__(self)
|
|
@@ -747,7 +762,9 @@ class PyLegendNumberArcTanExpression(PyLegendUnaryExpression, PyLegendExpression
|
|
|
747
762
|
self,
|
|
748
763
|
operand,
|
|
749
764
|
PyLegendNumberArcTanExpression.__to_sql_func,
|
|
750
|
-
PyLegendNumberArcTanExpression.__to_pure_func
|
|
765
|
+
PyLegendNumberArcTanExpression.__to_pure_func,
|
|
766
|
+
non_nullable=True,
|
|
767
|
+
operand_needs_to_be_non_nullable=True,
|
|
751
768
|
)
|
|
752
769
|
|
|
753
770
|
|
|
@@ -764,7 +781,7 @@ class PyLegendNumberArcTan2Expression(PyLegendBinaryExpression, PyLegendExpressi
|
|
|
764
781
|
|
|
765
782
|
@staticmethod
|
|
766
783
|
def __to_pure_func(op1_expr: str, op2_expr: str, config: FrameToPureConfig) -> str:
|
|
767
|
-
return generate_pure_functional_call("atan2", [op1_expr, op2_expr]
|
|
784
|
+
return generate_pure_functional_call("atan2", [op1_expr, op2_expr])
|
|
768
785
|
|
|
769
786
|
def __init__(self, operand1: PyLegendExpressionNumberReturn, operand2: PyLegendExpressionNumberReturn) -> None:
|
|
770
787
|
PyLegendExpressionNumberReturn.__init__(self)
|
|
@@ -773,12 +790,12 @@ class PyLegendNumberArcTan2Expression(PyLegendBinaryExpression, PyLegendExpressi
|
|
|
773
790
|
operand1,
|
|
774
791
|
operand2,
|
|
775
792
|
PyLegendNumberArcTan2Expression.__to_sql_func,
|
|
776
|
-
PyLegendNumberArcTan2Expression.__to_pure_func
|
|
793
|
+
PyLegendNumberArcTan2Expression.__to_pure_func,
|
|
794
|
+
non_nullable=True,
|
|
795
|
+
first_operand_needs_to_be_non_nullable=True,
|
|
796
|
+
second_operand_needs_to_be_non_nullable=True
|
|
777
797
|
)
|
|
778
798
|
|
|
779
|
-
def to_pure_expression(self, config: FrameToPureConfig) -> str:
|
|
780
|
-
return PyLegendBinaryExpression.to_pure_expression_with_to_one_on_second_operand(self, config)
|
|
781
|
-
|
|
782
799
|
|
|
783
800
|
class PyLegendNumberCotExpression(PyLegendUnaryExpression, PyLegendExpressionNumberReturn):
|
|
784
801
|
|
|
@@ -792,7 +809,7 @@ class PyLegendNumberCotExpression(PyLegendUnaryExpression, PyLegendExpressionNum
|
|
|
792
809
|
|
|
793
810
|
@staticmethod
|
|
794
811
|
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
795
|
-
return generate_pure_functional_call("cot", [op_expr]
|
|
812
|
+
return generate_pure_functional_call("cot", [op_expr])
|
|
796
813
|
|
|
797
814
|
def __init__(self, operand: PyLegendExpressionNumberReturn) -> None:
|
|
798
815
|
PyLegendExpressionNumberReturn.__init__(self)
|
|
@@ -800,5 +817,7 @@ class PyLegendNumberCotExpression(PyLegendUnaryExpression, PyLegendExpressionNum
|
|
|
800
817
|
self,
|
|
801
818
|
operand,
|
|
802
819
|
PyLegendNumberCotExpression.__to_sql_func,
|
|
803
|
-
PyLegendNumberCotExpression.__to_pure_func
|
|
820
|
+
PyLegendNumberCotExpression.__to_pure_func,
|
|
821
|
+
non_nullable=True,
|
|
822
|
+
operand_needs_to_be_non_nullable=True,
|
|
804
823
|
)
|