pylegend 0.8.0__py3-none-any.whl → 0.9.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/_typing.py +6 -0
- pylegend/core/database/sql_to_string/db_extension.py +35 -6
- pylegend/core/language/pandas_api/__init__.py +13 -0
- pylegend/core/language/pandas_api/pandas_api_aggregate_specification.py +54 -0
- pylegend/core/language/pandas_api/pandas_api_custom_expressions.py +85 -0
- pylegend/core/language/pandas_api/pandas_api_series.py +174 -0
- pylegend/core/language/pandas_api/pandas_api_tds_row.py +74 -0
- pylegend/core/language/shared/operations/integer_operation_expressions.py +35 -0
- pylegend/core/language/shared/operations/nary_expression.py +104 -0
- pylegend/core/language/shared/operations/primitive_operation_expressions.py +30 -0
- pylegend/core/language/shared/operations/string_operation_expressions.py +624 -1
- pylegend/core/language/shared/primitives/integer.py +6 -0
- pylegend/core/language/shared/primitives/primitive.py +6 -0
- pylegend/core/language/shared/primitives/string.py +129 -1
- pylegend/core/sql/metamodel.py +3 -1
- pylegend/core/sql/metamodel_extension.py +18 -0
- pylegend/core/tds/pandas_api/frames/functions/aggregate_function.py +316 -0
- pylegend/core/tds/pandas_api/frames/functions/assign_function.py +20 -15
- pylegend/core/tds/pandas_api/frames/functions/drop.py +171 -0
- pylegend/core/tds/pandas_api/frames/functions/filter.py +193 -0
- pylegend/core/tds/pandas_api/frames/functions/filtering.py +85 -0
- pylegend/core/tds/pandas_api/frames/functions/sort_values_function.py +189 -0
- pylegend/core/tds/pandas_api/frames/functions/truncate_function.py +120 -0
- pylegend/core/tds/pandas_api/frames/pandas_api_applied_function_tds_frame.py +5 -1
- pylegend/core/tds/pandas_api/frames/pandas_api_base_tds_frame.py +204 -7
- pylegend/core/tds/pandas_api/frames/pandas_api_input_tds_frame.py +5 -3
- pylegend/core/tds/pandas_api/frames/pandas_api_tds_frame.py +90 -3
- {pylegend-0.8.0.dist-info → pylegend-0.9.0.dist-info}/METADATA +1 -1
- {pylegend-0.8.0.dist-info → pylegend-0.9.0.dist-info}/RECORD +33 -21
- {pylegend-0.8.0.dist-info → pylegend-0.9.0.dist-info}/WHEEL +0 -0
- {pylegend-0.8.0.dist-info → pylegend-0.9.0.dist-info}/licenses/LICENSE +0 -0
- {pylegend-0.8.0.dist-info → pylegend-0.9.0.dist-info}/licenses/LICENSE.spdx +0 -0
- {pylegend-0.8.0.dist-info → pylegend-0.9.0.dist-info}/licenses/NOTICE +0 -0
|
@@ -19,6 +19,7 @@ from pylegend._typing import (
|
|
|
19
19
|
from pylegend.core.language.shared.expression import (
|
|
20
20
|
PyLegendExpression,
|
|
21
21
|
PyLegendExpressionBooleanReturn,
|
|
22
|
+
PyLegendExpressionStringReturn
|
|
22
23
|
)
|
|
23
24
|
from pylegend.core.language.shared.helpers import generate_pure_functional_call
|
|
24
25
|
from pylegend.core.language.shared.operations.binary_expression import PyLegendBinaryExpression
|
|
@@ -30,6 +31,8 @@ from pylegend.core.sql.metamodel import (
|
|
|
30
31
|
ComparisonOperator,
|
|
31
32
|
IsNullPredicate,
|
|
32
33
|
IsNotNullPredicate,
|
|
34
|
+
Cast,
|
|
35
|
+
ColumnType
|
|
33
36
|
)
|
|
34
37
|
from pylegend.core.tds.tds_frame import FrameToSqlConfig
|
|
35
38
|
from pylegend.core.tds.tds_frame import FrameToPureConfig
|
|
@@ -40,6 +43,7 @@ __all__: PyLegendSequence[str] = [
|
|
|
40
43
|
"PyLegendPrimitiveNotEqualsExpression",
|
|
41
44
|
"PyLegendIsEmptyExpression",
|
|
42
45
|
"PyLegendIsNotEmptyExpression",
|
|
46
|
+
"PyLegendPrimitiveToStringExpression"
|
|
43
47
|
]
|
|
44
48
|
|
|
45
49
|
|
|
@@ -145,3 +149,29 @@ class PyLegendIsNotEmptyExpression(PyLegendUnaryExpression, PyLegendExpressionBo
|
|
|
145
149
|
PyLegendIsNotEmptyExpression.__to_pure_func,
|
|
146
150
|
non_nullable=True,
|
|
147
151
|
)
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
class PyLegendPrimitiveToStringExpression(PyLegendUnaryExpression, PyLegendExpressionStringReturn):
|
|
155
|
+
|
|
156
|
+
@staticmethod
|
|
157
|
+
def __to_sql_func(
|
|
158
|
+
expression: Expression,
|
|
159
|
+
frame_name_to_base_query_map: PyLegendDict[str, QuerySpecification],
|
|
160
|
+
config: FrameToSqlConfig
|
|
161
|
+
) -> Expression:
|
|
162
|
+
return Cast(expression, ColumnType(name="TEXT", parameters=[]))
|
|
163
|
+
|
|
164
|
+
@staticmethod
|
|
165
|
+
def __to_pure_func(op_expr: str, config: FrameToPureConfig) -> str:
|
|
166
|
+
return generate_pure_functional_call("toString", [op_expr])
|
|
167
|
+
|
|
168
|
+
def __init__(self, operand: PyLegendExpression) -> None:
|
|
169
|
+
PyLegendExpressionStringReturn.__init__(self)
|
|
170
|
+
PyLegendUnaryExpression.__init__(
|
|
171
|
+
self,
|
|
172
|
+
operand,
|
|
173
|
+
PyLegendPrimitiveToStringExpression.__to_sql_func,
|
|
174
|
+
PyLegendPrimitiveToStringExpression.__to_pure_func,
|
|
175
|
+
non_nullable=True,
|
|
176
|
+
operand_needs_to_be_non_nullable=True,
|
|
177
|
+
)
|