pylegend 0.6.0__tar.gz → 0.8.0__tar.gz
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-0.6.0 → pylegend-0.8.0}/PKG-INFO +5 -2
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/__init__.py +7 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/language/shared/literal_expressions.py +2 -2
- pylegend-0.8.0/pylegend/core/language/shared/pct_helpers.py +56 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/legendql_api/frames/functions/legendql_api_window_extend_function.py +1 -1
- pylegend-0.8.0/pylegend/extensions/tds/legendql_api/frames/legendql_api_legend_function_input_frame.py +46 -0
- pylegend-0.8.0/pylegend/legendql_api_tds_client.py +73 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pyproject.toml +2 -1
- {pylegend-0.6.0 → pylegend-0.8.0}/LICENSE +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/LICENSE.spdx +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/NOTICE +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/README.md +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/_typing.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/__init__.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/database/__init__.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/database/sql_to_string/__init__.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/database/sql_to_string/config.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/database/sql_to_string/db_extension.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/database/sql_to_string/generator.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/language/__init__.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/language/legacy_api/__init__.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/language/legacy_api/aggregate_specification.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/language/legacy_api/legacy_api_tds_row.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/language/legendql_api/__init__.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/language/legendql_api/legendql_api_custom_expressions.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/language/legendql_api/legendql_api_tds_row.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/language/shared/__init__.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/language/shared/column_expressions.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/language/shared/expression.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/language/shared/functions.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/language/shared/helpers.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/language/shared/operations/__init__.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/language/shared/operations/binary_expression.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/language/shared/operations/boolean_operation_expressions.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/language/shared/operations/collection_operation_expressions.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/language/shared/operations/date_operation_expressions.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/language/shared/operations/float_operation_expressions.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/language/shared/operations/integer_operation_expressions.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/language/shared/operations/nullary_expression.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/language/shared/operations/number_operation_expressions.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/language/shared/operations/primitive_operation_expressions.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/language/shared/operations/string_operation_expressions.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/language/shared/operations/unary_expression.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/language/shared/primitive_collection.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/language/shared/primitives/__init__.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/language/shared/primitives/boolean.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/language/shared/primitives/date.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/language/shared/primitives/datetime.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/language/shared/primitives/float.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/language/shared/primitives/integer.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/language/shared/primitives/number.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/language/shared/primitives/primitive.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/language/shared/primitives/strictdate.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/language/shared/primitives/string.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/language/shared/tds_row.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/project_cooridnates.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/request/__init__.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/request/auth.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/request/legend_client.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/request/response_reader.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/request/service_client.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/sql/__init__.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/sql/metamodel.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/sql/metamodel_extension.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/__init__.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/abstract/__init__.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/abstract/frames/__init__.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/abstract/frames/applied_function_tds_frame.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/abstract/frames/base_tds_frame.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/abstract/frames/input_tds_frame.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/abstract/function_helpers.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/legacy_api/__init__.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/legacy_api/frames/__init__.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/legacy_api/frames/functions/__init__.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/legacy_api/frames/functions/legacy_api_concatenate_function.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/legacy_api/frames/functions/legacy_api_distinct_function.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/legacy_api/frames/functions/legacy_api_drop_function.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/legacy_api/frames/functions/legacy_api_extend_function.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/legacy_api/frames/functions/legacy_api_filter_function.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/legacy_api/frames/functions/legacy_api_group_by_function.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/legacy_api/frames/functions/legacy_api_head_function.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/legacy_api/frames/functions/legacy_api_join_by_columns_function.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/legacy_api/frames/functions/legacy_api_join_function.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/legacy_api/frames/functions/legacy_api_rename_columns_function.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/legacy_api/frames/functions/legacy_api_restrict_function.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/legacy_api/frames/functions/legacy_api_slice_function.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/legacy_api/frames/functions/legacy_api_sort_function.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/legacy_api/frames/legacy_api_applied_function_tds_frame.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/legacy_api/frames/legacy_api_base_tds_frame.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/legacy_api/frames/legacy_api_input_tds_frame.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/legacy_api/frames/legacy_api_tds_frame.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/legendql_api/__init__.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/legendql_api/frames/__init__.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/legendql_api/frames/functions/__init__.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/legendql_api/frames/functions/legendql_api_asofjoin_function.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/legendql_api/frames/functions/legendql_api_concatenate_function.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/legendql_api/frames/functions/legendql_api_distinct_function.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/legendql_api/frames/functions/legendql_api_drop_function.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/legendql_api/frames/functions/legendql_api_extend_function.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/legendql_api/frames/functions/legendql_api_filter_function.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/legendql_api/frames/functions/legendql_api_function_helpers.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/legendql_api/frames/functions/legendql_api_groupby_function.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/legendql_api/frames/functions/legendql_api_head_function.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/legendql_api/frames/functions/legendql_api_join_function.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/legendql_api/frames/functions/legendql_api_project_function.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/legendql_api/frames/functions/legendql_api_rename_function.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/legendql_api/frames/functions/legendql_api_select_function.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/legendql_api/frames/functions/legendql_api_slice_function.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/legendql_api/frames/functions/legendql_api_sort_function.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/legendql_api/frames/legendql_api_applied_function_tds_frame.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/legendql_api/frames/legendql_api_base_tds_frame.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/legendql_api/frames/legendql_api_input_tds_frame.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/legendql_api/frames/legendql_api_tds_frame.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/pandas_api/__init__.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/pandas_api/frames/__init__.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/pandas_api/frames/functions/__init__.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/pandas_api/frames/functions/assign_function.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/pandas_api/frames/pandas_api_applied_function_tds_frame.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/pandas_api/frames/pandas_api_base_tds_frame.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/pandas_api/frames/pandas_api_input_tds_frame.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/pandas_api/frames/pandas_api_tds_frame.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/result_handler/__init__.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/result_handler/result_handler.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/result_handler/to_csv_file_result_handler.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/result_handler/to_json_file_result_handler.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/result_handler/to_string_result_handler.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/sql_query_helpers.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/tds_column.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/tds_frame.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/extensions/__init__.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/extensions/database/__init__.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/extensions/database/vendors/__init__.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/extensions/database/vendors/postgres/__init__.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/extensions/database/vendors/postgres/postgres_sql_to_string.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/extensions/tds/__init__.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/extensions/tds/abstract/__init__.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/extensions/tds/abstract/legend_function_input_frame.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/extensions/tds/abstract/legend_service_input_frame.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/extensions/tds/abstract/table_spec_input_frame.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/extensions/tds/legacy_api/__init__.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/extensions/tds/legacy_api/frames/__init__.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/extensions/tds/legacy_api/frames/legacy_api_legend_function_input_frame.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/extensions/tds/legacy_api/frames/legacy_api_legend_service_input_frame.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/extensions/tds/legacy_api/frames/legacy_api_table_spec_input_frame.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/extensions/tds/legendql_api/__init__.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/extensions/tds/legendql_api/frames/__init__.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/extensions/tds/legendql_api/frames/legendql_api_legend_service_input_frame.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/extensions/tds/legendql_api/frames/legendql_api_table_spec_input_frame.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/extensions/tds/pandas_api/__init__.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/extensions/tds/pandas_api/frames/__init__.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/extensions/tds/pandas_api/frames/pandas_api_legend_function_input_frame.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/extensions/tds/pandas_api/frames/pandas_api_legend_service_input_frame.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/extensions/tds/pandas_api/frames/pandas_api_table_spec_input_frame.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/extensions/tds/result_handler/__init__.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/extensions/tds/result_handler/to_pandas_df_result_handler.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/legacy_api_tds_client.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/utils/__init__.py +0 -0
- {pylegend-0.6.0 → pylegend-0.8.0}/pylegend/utils/class_utils.py +0 -0
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: pylegend
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.8.0
|
|
4
4
|
Summary: Python language binding for Legend data management platform
|
|
5
5
|
License: Apache-2.0
|
|
6
|
+
License-File: LICENSE
|
|
7
|
+
License-File: LICENSE.spdx
|
|
8
|
+
License-File: NOTICE
|
|
6
9
|
Author: PyLegend Maintainers
|
|
7
10
|
Author-email: legend@finos.org
|
|
8
11
|
Requires-Python: >=3.9,<3.14
|
|
@@ -19,6 +19,10 @@ from pylegend.legacy_api_tds_client import (
|
|
|
19
19
|
LegacyApiTdsClient,
|
|
20
20
|
legacy_api_tds_client,
|
|
21
21
|
)
|
|
22
|
+
from pylegend.legendql_api_tds_client import (
|
|
23
|
+
LegendQLApiTdsClient,
|
|
24
|
+
legendql_api_tds_client,
|
|
25
|
+
)
|
|
22
26
|
from pylegend.core.request import (
|
|
23
27
|
LegendClient,
|
|
24
28
|
AuthScheme,
|
|
@@ -43,6 +47,9 @@ from pylegend.core.language import (
|
|
|
43
47
|
__all__: PyLegendSequence[str] = [
|
|
44
48
|
"__version__",
|
|
45
49
|
|
|
50
|
+
"LegendQLApiTdsClient",
|
|
51
|
+
"legendql_api_tds_client",
|
|
52
|
+
|
|
46
53
|
"LegacyApiTdsClient",
|
|
47
54
|
"legacy_api_tds_client",
|
|
48
55
|
|
|
@@ -108,7 +108,7 @@ class PyLegendIntegerLiteralExpression(PyLegendExpressionIntegerReturn):
|
|
|
108
108
|
return IntegerLiteral(value=self.__value)
|
|
109
109
|
|
|
110
110
|
def to_pure_expression(self, config: FrameToPureConfig) -> str:
|
|
111
|
-
return str(self.__value)
|
|
111
|
+
return f"minus({abs(self.__value)})" if self.__value < 0 else str(self.__value)
|
|
112
112
|
|
|
113
113
|
def is_non_nullable(self) -> bool:
|
|
114
114
|
return True
|
|
@@ -128,7 +128,7 @@ class PyLegendFloatLiteralExpression(PyLegendExpressionFloatReturn):
|
|
|
128
128
|
return DoubleLiteral(value=self.__value)
|
|
129
129
|
|
|
130
130
|
def to_pure_expression(self, config: FrameToPureConfig) -> str:
|
|
131
|
-
return str(self.__value)
|
|
131
|
+
return f"minus({abs(self.__value)})" if self.__value < 0 else str(self.__value)
|
|
132
132
|
|
|
133
133
|
def is_non_nullable(self) -> bool:
|
|
134
134
|
return True
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Copyright 2025 Goldman Sachs
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
from datetime import datetime, date
|
|
16
|
+
from pylegend._typing import (
|
|
17
|
+
PyLegendSequence,
|
|
18
|
+
PyLegendUnion,
|
|
19
|
+
)
|
|
20
|
+
from pylegend.core.language import (
|
|
21
|
+
convert_literal_to_literal_expression,
|
|
22
|
+
PyLegendBooleanLiteralExpression,
|
|
23
|
+
PyLegendStringLiteralExpression,
|
|
24
|
+
PyLegendIntegerLiteralExpression,
|
|
25
|
+
PyLegendFloatLiteralExpression,
|
|
26
|
+
PyLegendStrictDateLiteralExpression,
|
|
27
|
+
PyLegendDateTimeLiteralExpression,
|
|
28
|
+
PyLegendFloat,
|
|
29
|
+
PyLegendDateTime,
|
|
30
|
+
PyLegendStrictDate,
|
|
31
|
+
PyLegendString,
|
|
32
|
+
PyLegendInteger,
|
|
33
|
+
PyLegendBoolean,
|
|
34
|
+
PyLegendPrimitive
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
__all__: PyLegendSequence[str] = [
|
|
38
|
+
"c",
|
|
39
|
+
]
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def c(constant: PyLegendUnion[int, float, bool, str, datetime, date]) -> PyLegendPrimitive:
|
|
43
|
+
expr = convert_literal_to_literal_expression(constant)
|
|
44
|
+
if isinstance(expr, PyLegendBooleanLiteralExpression):
|
|
45
|
+
return PyLegendBoolean(expr)
|
|
46
|
+
if isinstance(expr, PyLegendStringLiteralExpression):
|
|
47
|
+
return PyLegendString(expr)
|
|
48
|
+
if isinstance(expr, PyLegendIntegerLiteralExpression):
|
|
49
|
+
return PyLegendInteger(expr)
|
|
50
|
+
if isinstance(expr, PyLegendFloatLiteralExpression):
|
|
51
|
+
return PyLegendFloat(expr)
|
|
52
|
+
if isinstance(expr, PyLegendDateTimeLiteralExpression):
|
|
53
|
+
return PyLegendDateTime(expr)
|
|
54
|
+
if isinstance(expr, PyLegendStrictDateLiteralExpression):
|
|
55
|
+
return PyLegendStrictDate(expr)
|
|
56
|
+
raise RuntimeError(f"Unsupported constant type: {type(constant)}")
|
|
@@ -186,7 +186,7 @@ class LegendQLApiWindowExtendFunction(LegendQLApiAppliedFunction):
|
|
|
186
186
|
|
|
187
187
|
def to_sql(self, config: FrameToSqlConfig) -> QuerySpecification:
|
|
188
188
|
base_query = self.__base_frame.to_sql_query_object(config)
|
|
189
|
-
should_create_sub_query =
|
|
189
|
+
should_create_sub_query = True
|
|
190
190
|
db_extension = config.sql_to_string_generator().get_db_extension()
|
|
191
191
|
|
|
192
192
|
new_query = (
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Copyright 2025 Goldman Sachs
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
from pylegend._typing import (
|
|
16
|
+
PyLegendSequence
|
|
17
|
+
)
|
|
18
|
+
from pylegend.core.tds.legendql_api.frames.legendql_api_input_tds_frame import LegendQLApiExecutableInputTdsFrame
|
|
19
|
+
from pylegend.core.project_cooridnates import ProjectCoordinates
|
|
20
|
+
from pylegend.core.request.legend_client import LegendClient
|
|
21
|
+
from pylegend.extensions.tds.abstract.legend_function_input_frame import LegendFunctionInputFrameAbstract
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
__all__: PyLegendSequence[str] = [
|
|
25
|
+
"LegendQLApiLegendFunctionInputFrame"
|
|
26
|
+
]
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class LegendQLApiLegendFunctionInputFrame(LegendFunctionInputFrameAbstract, LegendQLApiExecutableInputTdsFrame):
|
|
30
|
+
|
|
31
|
+
def __init__(
|
|
32
|
+
self,
|
|
33
|
+
path: str,
|
|
34
|
+
project_coordinates: ProjectCoordinates,
|
|
35
|
+
legend_client: LegendClient,
|
|
36
|
+
) -> None:
|
|
37
|
+
LegendFunctionInputFrameAbstract.__init__(self, path=path, project_coordinates=project_coordinates)
|
|
38
|
+
LegendQLApiExecutableInputTdsFrame.__init__(
|
|
39
|
+
self,
|
|
40
|
+
legend_client=legend_client,
|
|
41
|
+
columns=legend_client.get_sql_string_schema(self.to_sql_query())
|
|
42
|
+
)
|
|
43
|
+
LegendFunctionInputFrameAbstract.set_initialized(self, True)
|
|
44
|
+
|
|
45
|
+
def __str__(self) -> str:
|
|
46
|
+
return f"LegendQLApiLegendFunctionInputFrame({'.'.join(self.get_path())})"
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Copyright 2025 Goldman Sachs
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
from pylegend._typing import (
|
|
17
|
+
PyLegendSequence,
|
|
18
|
+
)
|
|
19
|
+
from pylegend.core.request import LegendClient
|
|
20
|
+
from pylegend.core.project_cooridnates import ProjectCoordinates
|
|
21
|
+
from pylegend.core.tds.legendql_api.frames.legendql_api_tds_frame import LegendQLApiTdsFrame
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
__all__: PyLegendSequence[str] = [
|
|
25
|
+
"LegendQLApiTdsClient",
|
|
26
|
+
"legendql_api_tds_client",
|
|
27
|
+
]
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class LegendQLApiTdsClient:
|
|
31
|
+
__legend_client: LegendClient
|
|
32
|
+
|
|
33
|
+
def __init__(
|
|
34
|
+
self,
|
|
35
|
+
legend_client: LegendClient
|
|
36
|
+
) -> None:
|
|
37
|
+
self.__legend_client = legend_client
|
|
38
|
+
|
|
39
|
+
def legend_service_frame(
|
|
40
|
+
self,
|
|
41
|
+
service_pattern: str,
|
|
42
|
+
project_coordinates: ProjectCoordinates
|
|
43
|
+
) -> LegendQLApiTdsFrame:
|
|
44
|
+
from pylegend.extensions.tds.legendql_api.frames.legendql_api_legend_service_input_frame import (
|
|
45
|
+
LegendQLApiLegendServiceInputFrame
|
|
46
|
+
)
|
|
47
|
+
return LegendQLApiLegendServiceInputFrame(
|
|
48
|
+
pattern=service_pattern,
|
|
49
|
+
project_coordinates=project_coordinates,
|
|
50
|
+
legend_client=self.__legend_client
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
def legend_function_frame(
|
|
54
|
+
self,
|
|
55
|
+
function_path: str,
|
|
56
|
+
project_coordinates: ProjectCoordinates
|
|
57
|
+
) -> LegendQLApiTdsFrame:
|
|
58
|
+
from pylegend.extensions.tds.legendql_api.frames.legendql_api_legend_function_input_frame import (
|
|
59
|
+
LegendQLApiLegendFunctionInputFrame
|
|
60
|
+
)
|
|
61
|
+
return LegendQLApiLegendFunctionInputFrame(
|
|
62
|
+
path=function_path,
|
|
63
|
+
project_coordinates=project_coordinates,
|
|
64
|
+
legend_client=self.__legend_client
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def legendql_api_tds_client(
|
|
69
|
+
legend_client: LegendClient
|
|
70
|
+
) -> LegendQLApiTdsClient:
|
|
71
|
+
return LegendQLApiTdsClient(
|
|
72
|
+
legend_client=legend_client
|
|
73
|
+
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "pylegend"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.8.0"
|
|
4
4
|
description = "Python language binding for Legend data management platform"
|
|
5
5
|
authors = ["PyLegend Maintainers <legend@finos.org>"]
|
|
6
6
|
license = "Apache-2.0"
|
|
@@ -36,6 +36,7 @@ sqlalchemy = ">=2.0.0"
|
|
|
36
36
|
pg8000 = ">=1.0.0"
|
|
37
37
|
pymysql = ">=1.0.0"
|
|
38
38
|
cryptography = ">=40.0.0"
|
|
39
|
+
wrapt = "<2.0.0"
|
|
39
40
|
|
|
40
41
|
[build-system]
|
|
41
42
|
requires = ["poetry-core"]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/language/legacy_api/aggregate_specification.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/language/legendql_api/legendql_api_tds_row.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/language/shared/operations/binary_expression.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/language/shared/operations/nullary_expression.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/language/shared/operations/unary_expression.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/abstract/frames/applied_function_tds_frame.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/legacy_api/frames/legacy_api_base_tds_frame.py
RENAMED
|
File without changes
|
{pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/legacy_api/frames/legacy_api_input_tds_frame.py
RENAMED
|
File without changes
|
{pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/legacy_api/frames/legacy_api_tds_frame.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/legendql_api/frames/functions/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/legendql_api/frames/legendql_api_tds_frame.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/pandas_api/frames/functions/assign_function.py
RENAMED
|
File without changes
|
|
File without changes
|
{pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/pandas_api/frames/pandas_api_base_tds_frame.py
RENAMED
|
File without changes
|
{pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/pandas_api/frames/pandas_api_input_tds_frame.py
RENAMED
|
File without changes
|
{pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/pandas_api/frames/pandas_api_tds_frame.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/result_handler/to_csv_file_result_handler.py
RENAMED
|
File without changes
|
{pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/result_handler/to_json_file_result_handler.py
RENAMED
|
File without changes
|
{pylegend-0.6.0 → pylegend-0.8.0}/pylegend/core/tds/result_handler/to_string_result_handler.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pylegend-0.6.0 → pylegend-0.8.0}/pylegend/extensions/tds/abstract/legend_function_input_frame.py
RENAMED
|
File without changes
|
{pylegend-0.6.0 → pylegend-0.8.0}/pylegend/extensions/tds/abstract/legend_service_input_frame.py
RENAMED
|
File without changes
|
{pylegend-0.6.0 → pylegend-0.8.0}/pylegend/extensions/tds/abstract/table_spec_input_frame.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|