pylegend 0.3.0__tar.gz → 0.5.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.5.0/NOTICE +5 -0
- {pylegend-0.3.0 → pylegend-0.5.0}/PKG-INFO +7 -8
- {pylegend-0.3.0 → pylegend-0.5.0}/README.md +3 -3
- {pylegend-0.3.0 → pylegend-0.5.0}/pylegend/__init__.py +16 -6
- {pylegend-0.3.0/pylegend/core/databse → pylegend-0.5.0/pylegend/core/database}/sql_to_string/__init__.py +3 -3
- {pylegend-0.3.0/pylegend/core/databse → pylegend-0.5.0/pylegend/core/database}/sql_to_string/db_extension.py +14 -5
- {pylegend-0.3.0/pylegend/core/databse → pylegend-0.5.0/pylegend/core/database}/sql_to_string/generator.py +2 -2
- {pylegend-0.3.0 → pylegend-0.5.0}/pylegend/core/language/__init__.py +12 -10
- pylegend-0.5.0/pylegend/core/language/legacy_api/__init__.py +13 -0
- {pylegend-0.3.0/pylegend/core/language → pylegend-0.5.0/pylegend/core/language/legacy_api}/aggregate_specification.py +10 -10
- pylegend-0.5.0/pylegend/core/language/legacy_api/legacy_api_tds_row.py +32 -0
- pylegend-0.5.0/pylegend/core/language/legendql_api/__init__.py +13 -0
- pylegend-0.5.0/pylegend/core/language/legendql_api/legendql_api_custom_expressions.py +541 -0
- pylegend-0.5.0/pylegend/core/language/legendql_api/legendql_api_tds_row.py +292 -0
- pylegend-0.5.0/pylegend/core/language/shared/__init__.py +13 -0
- {pylegend-0.3.0/pylegend/core/language → pylegend-0.5.0/pylegend/core/language/shared}/column_expressions.py +32 -31
- {pylegend-0.3.0/pylegend/core/language → pylegend-0.5.0/pylegend/core/language/shared}/expression.py +8 -0
- {pylegend-0.3.0/pylegend/core/language → pylegend-0.5.0/pylegend/core/language/shared}/functions.py +12 -3
- pylegend-0.5.0/pylegend/core/language/shared/helpers.py +75 -0
- {pylegend-0.3.0/pylegend/core/language → pylegend-0.5.0/pylegend/core/language/shared}/literal_expressions.py +39 -1
- {pylegend-0.3.0/pylegend/core/language → pylegend-0.5.0/pylegend/core/language/shared}/operations/binary_expression.py +34 -2
- {pylegend-0.3.0/pylegend/core/language → pylegend-0.5.0/pylegend/core/language/shared}/operations/boolean_operation_expressions.py +34 -6
- {pylegend-0.3.0/pylegend/core/language → pylegend-0.5.0/pylegend/core/language/shared}/operations/collection_operation_expressions.py +146 -26
- {pylegend-0.3.0/pylegend/core/language → pylegend-0.5.0/pylegend/core/language/shared}/operations/date_operation_expressions.py +288 -24
- {pylegend-0.3.0/pylegend/core/language → pylegend-0.5.0/pylegend/core/language/shared}/operations/float_operation_expressions.py +53 -8
- {pylegend-0.3.0/pylegend/core/language → pylegend-0.5.0/pylegend/core/language/shared}/operations/integer_operation_expressions.py +62 -9
- {pylegend-0.3.0/pylegend/core/language → pylegend-0.5.0/pylegend/core/language/shared}/operations/nullary_expression.py +9 -2
- {pylegend-0.3.0/pylegend/core/language → pylegend-0.5.0/pylegend/core/language/shared}/operations/number_operation_expressions.py +211 -30
- pylegend-0.5.0/pylegend/core/language/shared/operations/primitive_operation_expressions.py +155 -0
- {pylegend-0.3.0/pylegend/core/language → pylegend-0.5.0/pylegend/core/language/shared}/operations/string_operation_expressions.py +194 -21
- {pylegend-0.3.0/pylegend/core/language → pylegend-0.5.0/pylegend/core/language/shared}/operations/unary_expression.py +10 -2
- {pylegend-0.3.0/pylegend/core/language → pylegend-0.5.0/pylegend/core/language/shared}/primitive_collection.py +2 -2
- {pylegend-0.3.0/pylegend/core/language → pylegend-0.5.0/pylegend/core/language/shared}/primitives/__init__.py +9 -9
- {pylegend-0.3.0/pylegend/core/language → pylegend-0.5.0/pylegend/core/language/shared}/primitives/boolean.py +9 -5
- {pylegend-0.3.0/pylegend/core/language → pylegend-0.5.0/pylegend/core/language/shared}/primitives/date.py +60 -15
- {pylegend-0.3.0/pylegend/core/language → pylegend-0.5.0/pylegend/core/language/shared}/primitives/datetime.py +4 -5
- {pylegend-0.3.0/pylegend/core/language → pylegend-0.5.0/pylegend/core/language/shared}/primitives/float.py +6 -6
- {pylegend-0.3.0/pylegend/core/language → pylegend-0.5.0/pylegend/core/language/shared}/primitives/integer.py +6 -6
- {pylegend-0.3.0/pylegend/core/language → pylegend-0.5.0/pylegend/core/language/shared}/primitives/number.py +16 -13
- {pylegend-0.3.0/pylegend/core/language → pylegend-0.5.0/pylegend/core/language/shared}/primitives/primitive.py +41 -5
- {pylegend-0.3.0/pylegend/core/language → pylegend-0.5.0/pylegend/core/language/shared}/primitives/strictdate.py +4 -5
- {pylegend-0.3.0/pylegend/core/language → pylegend-0.5.0/pylegend/core/language/shared}/primitives/string.py +18 -19
- {pylegend-0.3.0/pylegend/core/language → pylegend-0.5.0/pylegend/core/language/shared}/tds_row.py +46 -16
- {pylegend-0.3.0 → pylegend-0.5.0}/pylegend/core/request/__init__.py +7 -1
- {pylegend-0.3.0 → pylegend-0.5.0}/pylegend/core/request/auth.py +55 -1
- {pylegend-0.3.0 → pylegend-0.5.0}/pylegend/core/request/legend_client.py +32 -0
- {pylegend-0.3.0 → pylegend-0.5.0}/pylegend/core/sql/metamodel_extension.py +28 -0
- pylegend-0.5.0/pylegend/core/tds/abstract/__init__.py +13 -0
- pylegend-0.5.0/pylegend/core/tds/abstract/frames/__init__.py +13 -0
- pylegend-0.3.0/pylegend/core/tds/legend_api/frames/legend_api_applied_function_tds_frame.py → pylegend-0.5.0/pylegend/core/tds/abstract/frames/applied_function_tds_frame.py +19 -13
- pylegend-0.5.0/pylegend/core/tds/abstract/frames/base_tds_frame.py +125 -0
- pylegend-0.3.0/pylegend/core/tds/legend_api/frames/legend_api_input_tds_frame.py → pylegend-0.5.0/pylegend/core/tds/abstract/frames/input_tds_frame.py +9 -12
- {pylegend-0.3.0/pylegend/core/tds/legend_api/frames/functions → pylegend-0.5.0/pylegend/core/tds/abstract}/function_helpers.py +1 -1
- pylegend-0.3.0/pylegend/core/tds/legend_api/frames/functions/concatenate_function.py → pylegend-0.5.0/pylegend/core/tds/legacy_api/frames/functions/legacy_api_concatenate_function.py +25 -13
- pylegend-0.3.0/pylegend/core/tds/legend_api/frames/functions/distinct_function.py → pylegend-0.5.0/pylegend/core/tds/legacy_api/frames/functions/legacy_api_distinct_function.py +13 -8
- pylegend-0.3.0/pylegend/core/tds/legend_api/frames/functions/drop_function.py → pylegend-0.5.0/pylegend/core/tds/legacy_api/frames/functions/legacy_api_drop_function.py +13 -8
- pylegend-0.3.0/pylegend/core/tds/legend_api/frames/functions/extend_function.py → pylegend-0.5.0/pylegend/core/tds/legacy_api/frames/functions/legacy_api_extend_function.py +36 -16
- pylegend-0.3.0/pylegend/core/tds/legend_api/frames/functions/filter_function.py → pylegend-0.5.0/pylegend/core/tds/legacy_api/frames/functions/legacy_api_filter_function.py +25 -13
- pylegend-0.3.0/pylegend/core/tds/legend_api/frames/functions/group_by_function.py → pylegend-0.5.0/pylegend/core/tds/legacy_api/frames/functions/legacy_api_group_by_function.py +44 -17
- pylegend-0.3.0/pylegend/core/tds/legend_api/frames/functions/head_function.py → pylegend-0.5.0/pylegend/core/tds/legacy_api/frames/functions/legacy_api_head_function.py +13 -8
- pylegend-0.3.0/pylegend/core/tds/legend_api/frames/functions/join_by_columns_function.py → pylegend-0.5.0/pylegend/core/tds/legacy_api/frames/functions/legacy_api_join_by_columns_function.py +40 -13
- pylegend-0.3.0/pylegend/core/tds/legend_api/frames/functions/join_function.py → pylegend-0.5.0/pylegend/core/tds/legacy_api/frames/functions/legacy_api_join_function.py +44 -20
- pylegend-0.3.0/pylegend/core/tds/legend_api/frames/functions/rename_columns_function.py → pylegend-0.5.0/pylegend/core/tds/legacy_api/frames/functions/legacy_api_rename_columns_function.py +20 -8
- pylegend-0.3.0/pylegend/core/tds/legend_api/frames/functions/restrict_function.py → pylegend-0.5.0/pylegend/core/tds/legacy_api/frames/functions/legacy_api_restrict_function.py +17 -8
- pylegend-0.3.0/pylegend/core/tds/legend_api/frames/functions/slice_function.py → pylegend-0.5.0/pylegend/core/tds/legacy_api/frames/functions/legacy_api_slice_function.py +13 -8
- pylegend-0.3.0/pylegend/core/tds/legend_api/frames/functions/sort_function.py → pylegend-0.5.0/pylegend/core/tds/legacy_api/frames/functions/legacy_api_sort_function.py +19 -8
- pylegend-0.5.0/pylegend/core/tds/legacy_api/frames/legacy_api_applied_function_tds_frame.py +37 -0
- pylegend-0.5.0/pylegend/core/tds/legacy_api/frames/legacy_api_base_tds_frame.py +204 -0
- pylegend-0.5.0/pylegend/core/tds/legacy_api/frames/legacy_api_input_tds_frame.py +51 -0
- pylegend-0.3.0/pylegend/core/tds/legend_api/frames/legend_api_tds_frame.py → pylegend-0.5.0/pylegend/core/tds/legacy_api/frames/legacy_api_tds_frame.py +28 -28
- pylegend-0.5.0/pylegend/core/tds/legendql_api/__init__.py +13 -0
- pylegend-0.5.0/pylegend/core/tds/legendql_api/frames/__init__.py +13 -0
- pylegend-0.5.0/pylegend/core/tds/legendql_api/frames/functions/__init__.py +13 -0
- pylegend-0.5.0/pylegend/core/tds/legendql_api/frames/functions/legendql_api_asofjoin_function.py +156 -0
- pylegend-0.5.0/pylegend/core/tds/legendql_api/frames/functions/legendql_api_concatenate_function.py +139 -0
- pylegend-0.5.0/pylegend/core/tds/legendql_api/frames/functions/legendql_api_distinct_function.py +69 -0
- pylegend-0.5.0/pylegend/core/tds/legendql_api/frames/functions/legendql_api_drop_function.py +74 -0
- pylegend-0.5.0/pylegend/core/tds/legendql_api/frames/functions/legendql_api_extend_function.py +256 -0
- pylegend-0.5.0/pylegend/core/tds/legendql_api/frames/functions/legendql_api_filter_function.py +121 -0
- pylegend-0.5.0/pylegend/core/tds/legendql_api/frames/functions/legendql_api_function_helpers.py +137 -0
- pylegend-0.5.0/pylegend/core/tds/legendql_api/frames/functions/legendql_api_groupby_function.py +256 -0
- pylegend-0.5.0/pylegend/core/tds/legendql_api/frames/functions/legendql_api_head_function.py +74 -0
- pylegend-0.5.0/pylegend/core/tds/legendql_api/frames/functions/legendql_api_join_function.py +214 -0
- pylegend-0.5.0/pylegend/core/tds/legendql_api/frames/functions/legendql_api_project_function.py +169 -0
- pylegend-0.5.0/pylegend/core/tds/legendql_api/frames/functions/legendql_api_rename_function.py +189 -0
- pylegend-0.5.0/pylegend/core/tds/legendql_api/frames/functions/legendql_api_select_function.py +131 -0
- pylegend-0.5.0/pylegend/core/tds/legendql_api/frames/functions/legendql_api_slice_function.py +82 -0
- pylegend-0.5.0/pylegend/core/tds/legendql_api/frames/functions/legendql_api_sort_function.py +93 -0
- pylegend-0.5.0/pylegend/core/tds/legendql_api/frames/functions/legendql_api_window_extend_function.py +283 -0
- pylegend-0.5.0/pylegend/core/tds/legendql_api/frames/legendql_api_applied_function_tds_frame.py +37 -0
- pylegend-0.5.0/pylegend/core/tds/legendql_api/frames/legendql_api_base_tds_frame.py +419 -0
- pylegend-0.5.0/pylegend/core/tds/legendql_api/frames/legendql_api_input_tds_frame.py +50 -0
- pylegend-0.5.0/pylegend/core/tds/legendql_api/frames/legendql_api_tds_frame.py +327 -0
- {pylegend-0.3.0 → pylegend-0.5.0}/pylegend/core/tds/pandas_api/frames/functions/assign_function.py +6 -6
- {pylegend-0.3.0 → pylegend-0.5.0}/pylegend/core/tds/pandas_api/frames/pandas_api_applied_function_tds_frame.py +4 -0
- {pylegend-0.3.0 → pylegend-0.5.0}/pylegend/core/tds/pandas_api/frames/pandas_api_base_tds_frame.py +11 -3
- {pylegend-0.3.0 → pylegend-0.5.0}/pylegend/core/tds/pandas_api/frames/pandas_api_tds_frame.py +2 -2
- {pylegend-0.3.0 → pylegend-0.5.0}/pylegend/core/tds/tds_frame.py +32 -2
- {pylegend-0.3.0 → pylegend-0.5.0}/pylegend/extensions/database/vendors/postgres/postgres_sql_to_string.py +1 -1
- {pylegend-0.3.0 → pylegend-0.5.0}/pylegend/extensions/tds/abstract/legend_function_input_frame.py +4 -0
- {pylegend-0.3.0 → pylegend-0.5.0}/pylegend/extensions/tds/abstract/legend_service_input_frame.py +4 -0
- {pylegend-0.3.0 → pylegend-0.5.0}/pylegend/extensions/tds/abstract/table_spec_input_frame.py +4 -0
- pylegend-0.3.0/pylegend/extensions/tds/legend_api/frames/legend_api_legend_function_input_frame.py → pylegend-0.5.0/pylegend/extensions/tds/legacy_api/frames/legacy_api_legend_function_input_frame.py +5 -5
- pylegend-0.3.0/pylegend/extensions/tds/legend_api/frames/legend_api_legend_service_input_frame.py → pylegend-0.5.0/pylegend/extensions/tds/legacy_api/frames/legacy_api_legend_service_input_frame.py +6 -6
- pylegend-0.3.0/pylegend/extensions/tds/legend_api/frames/legend_api_table_spec_input_frame.py → pylegend-0.5.0/pylegend/extensions/tds/legacy_api/frames/legacy_api_table_spec_input_frame.py +5 -5
- pylegend-0.5.0/pylegend/extensions/tds/legendql_api/__init__.py +13 -0
- pylegend-0.5.0/pylegend/extensions/tds/legendql_api/frames/__init__.py +13 -0
- pylegend-0.5.0/pylegend/extensions/tds/legendql_api/frames/legendql_api_legend_service_input_frame.py +46 -0
- pylegend-0.5.0/pylegend/extensions/tds/legendql_api/frames/legendql_api_table_spec_input_frame.py +36 -0
- pylegend-0.3.0/pylegend/legend_api_tds_client.py → pylegend-0.5.0/pylegend/legacy_api_tds_client.py +15 -15
- {pylegend-0.3.0 → pylegend-0.5.0}/pyproject.toml +7 -2
- pylegend-0.3.0/pylegend/core/language/operations/primitive_operation_expressions.py +0 -56
- pylegend-0.3.0/pylegend/core/tds/legend_api/frames/legend_api_base_tds_frame.py +0 -294
- {pylegend-0.3.0 → pylegend-0.5.0}/LICENSE +0 -0
- {pylegend-0.3.0 → pylegend-0.5.0}/LICENSE.spdx +0 -0
- {pylegend-0.3.0 → pylegend-0.5.0}/pylegend/_typing.py +0 -0
- {pylegend-0.3.0 → pylegend-0.5.0}/pylegend/core/__init__.py +0 -0
- {pylegend-0.3.0/pylegend/core/databse → pylegend-0.5.0/pylegend/core/database}/__init__.py +0 -0
- {pylegend-0.3.0/pylegend/core/databse → pylegend-0.5.0/pylegend/core/database}/sql_to_string/config.py +0 -0
- {pylegend-0.3.0/pylegend/core/language → pylegend-0.5.0/pylegend/core/language/shared}/operations/__init__.py +0 -0
- {pylegend-0.3.0 → pylegend-0.5.0}/pylegend/core/project_cooridnates.py +0 -0
- {pylegend-0.3.0 → pylegend-0.5.0}/pylegend/core/request/response_reader.py +0 -0
- {pylegend-0.3.0 → pylegend-0.5.0}/pylegend/core/request/service_client.py +0 -0
- {pylegend-0.3.0 → pylegend-0.5.0}/pylegend/core/sql/__init__.py +0 -0
- {pylegend-0.3.0 → pylegend-0.5.0}/pylegend/core/sql/metamodel.py +0 -0
- {pylegend-0.3.0 → pylegend-0.5.0}/pylegend/core/tds/__init__.py +0 -0
- {pylegend-0.3.0/pylegend/core/tds/legend_api → pylegend-0.5.0/pylegend/core/tds/legacy_api}/__init__.py +0 -0
- {pylegend-0.3.0/pylegend/core/tds/legend_api → pylegend-0.5.0/pylegend/core/tds/legacy_api}/frames/__init__.py +0 -0
- {pylegend-0.3.0/pylegend/core/tds/legend_api → pylegend-0.5.0/pylegend/core/tds/legacy_api}/frames/functions/__init__.py +0 -0
- {pylegend-0.3.0 → pylegend-0.5.0}/pylegend/core/tds/pandas_api/__init__.py +0 -0
- {pylegend-0.3.0 → pylegend-0.5.0}/pylegend/core/tds/pandas_api/frames/__init__.py +0 -0
- {pylegend-0.3.0 → pylegend-0.5.0}/pylegend/core/tds/pandas_api/frames/functions/__init__.py +0 -0
- {pylegend-0.3.0 → pylegend-0.5.0}/pylegend/core/tds/pandas_api/frames/pandas_api_input_tds_frame.py +0 -0
- {pylegend-0.3.0 → pylegend-0.5.0}/pylegend/core/tds/result_handler/__init__.py +0 -0
- {pylegend-0.3.0 → pylegend-0.5.0}/pylegend/core/tds/result_handler/result_handler.py +0 -0
- {pylegend-0.3.0 → pylegend-0.5.0}/pylegend/core/tds/result_handler/to_csv_file_result_handler.py +0 -0
- {pylegend-0.3.0 → pylegend-0.5.0}/pylegend/core/tds/result_handler/to_json_file_result_handler.py +0 -0
- {pylegend-0.3.0 → pylegend-0.5.0}/pylegend/core/tds/result_handler/to_string_result_handler.py +0 -0
- {pylegend-0.3.0 → pylegend-0.5.0}/pylegend/core/tds/sql_query_helpers.py +0 -0
- {pylegend-0.3.0 → pylegend-0.5.0}/pylegend/core/tds/tds_column.py +0 -0
- {pylegend-0.3.0 → pylegend-0.5.0}/pylegend/extensions/__init__.py +0 -0
- {pylegend-0.3.0 → pylegend-0.5.0}/pylegend/extensions/database/__init__.py +0 -0
- {pylegend-0.3.0 → pylegend-0.5.0}/pylegend/extensions/database/vendors/__init__.py +0 -0
- {pylegend-0.3.0 → pylegend-0.5.0}/pylegend/extensions/database/vendors/postgres/__init__.py +0 -0
- {pylegend-0.3.0 → pylegend-0.5.0}/pylegend/extensions/tds/__init__.py +0 -0
- {pylegend-0.3.0 → pylegend-0.5.0}/pylegend/extensions/tds/abstract/__init__.py +0 -0
- {pylegend-0.3.0/pylegend/extensions/tds/legend_api → pylegend-0.5.0/pylegend/extensions/tds/legacy_api}/__init__.py +0 -0
- {pylegend-0.3.0/pylegend/extensions/tds/legend_api → pylegend-0.5.0/pylegend/extensions/tds/legacy_api}/frames/__init__.py +0 -0
- {pylegend-0.3.0 → pylegend-0.5.0}/pylegend/extensions/tds/pandas_api/__init__.py +0 -0
- {pylegend-0.3.0 → pylegend-0.5.0}/pylegend/extensions/tds/pandas_api/frames/__init__.py +0 -0
- {pylegend-0.3.0 → pylegend-0.5.0}/pylegend/extensions/tds/pandas_api/frames/pandas_api_legend_function_input_frame.py +0 -0
- {pylegend-0.3.0 → pylegend-0.5.0}/pylegend/extensions/tds/pandas_api/frames/pandas_api_legend_service_input_frame.py +0 -0
- {pylegend-0.3.0 → pylegend-0.5.0}/pylegend/extensions/tds/pandas_api/frames/pandas_api_table_spec_input_frame.py +0 -0
- {pylegend-0.3.0 → pylegend-0.5.0}/pylegend/extensions/tds/result_handler/__init__.py +0 -0
- {pylegend-0.3.0 → pylegend-0.5.0}/pylegend/extensions/tds/result_handler/to_pandas_df_result_handler.py +0 -0
- {pylegend-0.3.0 → pylegend-0.5.0}/pylegend/utils/__init__.py +0 -0
- {pylegend-0.3.0 → pylegend-0.5.0}/pylegend/utils/class_utils.py +0 -0
pylegend-0.5.0/NOTICE
ADDED
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
2
|
Name: pylegend
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.5.0
|
|
4
4
|
Summary: Python language binding for Legend data management platform
|
|
5
|
-
Home-page: https://github.com/finos/pylegend
|
|
6
5
|
License: Apache-2.0
|
|
7
6
|
Author: PyLegend Maintainers
|
|
8
7
|
Author-email: legend@finos.org
|
|
9
|
-
Requires-Python: >=3.
|
|
8
|
+
Requires-Python: >=3.9,<3.14
|
|
10
9
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
11
10
|
Classifier: Programming Language :: Python :: 3
|
|
12
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
13
11
|
Classifier: Programming Language :: Python :: 3.9
|
|
14
12
|
Classifier: Programming Language :: Python :: 3.10
|
|
15
13
|
Classifier: Programming Language :: Python :: 3.11
|
|
16
14
|
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
17
16
|
Requires-Dist: ijson (>=3.1.4)
|
|
18
17
|
Requires-Dist: numpy (>=1.20.0) ; python_version < "3.12"
|
|
19
18
|
Requires-Dist: numpy (>=1.26.0) ; python_version >= "3.12"
|
|
@@ -25,8 +24,8 @@ Description-Content-Type: text/markdown
|
|
|
25
24
|
|
|
26
25
|
[](https://community.finos.org/docs/governance/Software-Projects/stages/incubating)
|
|
27
26
|
[](https://pypi.org/project/pylegend/)
|
|
28
|
-
[](https://www.python.org/downloads)
|
|
28
|
+

|
|
30
29
|
[](https://opensource.org/licenses/Apache-2.0)
|
|
31
30
|

|
|
32
31
|

|
|
@@ -41,7 +40,7 @@ PyLegend is part of [Legend](https://github.com/finos/legend) data management pl
|
|
|
41
40
|
|
|
42
41
|
## Build from source
|
|
43
42
|
|
|
44
|
-
PyLegend requires Python 3.
|
|
43
|
+
PyLegend requires Python 3.9 or higher. We use [Poetry](https://python-poetry.org/) tool for dependency management and packaging. To install poetry, follow instructions [here](https://python-poetry.org/docs/#installation).
|
|
45
44
|
|
|
46
45
|
Run `poetry install` to install dependencies. If you intend to contribute, install dev dependencies using the command `poetry install --with dev`.
|
|
47
46
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
[](https://community.finos.org/docs/governance/Software-Projects/stages/incubating)
|
|
2
2
|
[](https://pypi.org/project/pylegend/)
|
|
3
|
-
[](https://www.python.org/downloads)
|
|
4
|
+

|
|
5
5
|
[](https://opensource.org/licenses/Apache-2.0)
|
|
6
6
|

|
|
7
7
|

|
|
@@ -16,7 +16,7 @@ PyLegend is part of [Legend](https://github.com/finos/legend) data management pl
|
|
|
16
16
|
|
|
17
17
|
## Build from source
|
|
18
18
|
|
|
19
|
-
PyLegend requires Python 3.
|
|
19
|
+
PyLegend requires Python 3.9 or higher. We use [Poetry](https://python-poetry.org/) tool for dependency management and packaging. To install poetry, follow instructions [here](https://python-poetry.org/docs/#installation).
|
|
20
20
|
|
|
21
21
|
Run `poetry install` to install dependencies. If you intend to contribute, install dev dependencies using the command `poetry install --with dev`.
|
|
22
22
|
|
|
@@ -15,15 +15,16 @@
|
|
|
15
15
|
from pylegend._typing import (
|
|
16
16
|
PyLegendSequence,
|
|
17
17
|
)
|
|
18
|
-
from pylegend.
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
from pylegend.legacy_api_tds_client import (
|
|
19
|
+
LegacyApiTdsClient,
|
|
20
|
+
legacy_api_tds_client,
|
|
21
21
|
)
|
|
22
22
|
from pylegend.core.request import (
|
|
23
23
|
LegendClient,
|
|
24
24
|
AuthScheme,
|
|
25
25
|
LocalhostEmptyAuthScheme,
|
|
26
26
|
HeaderTokenAuthScheme,
|
|
27
|
+
CookieAuthScheme,
|
|
27
28
|
ResponseReader,
|
|
28
29
|
)
|
|
29
30
|
from pylegend.core.project_cooridnates import (
|
|
@@ -31,19 +32,25 @@ from pylegend.core.project_cooridnates import (
|
|
|
31
32
|
PersonalWorkspaceProjectCoordinates,
|
|
32
33
|
GroupWorkspaceProjectCoordinates,
|
|
33
34
|
)
|
|
34
|
-
from pylegend.core.language import
|
|
35
|
+
from pylegend.core.language import (
|
|
36
|
+
agg,
|
|
37
|
+
now,
|
|
38
|
+
today,
|
|
39
|
+
current_user,
|
|
40
|
+
)
|
|
35
41
|
|
|
36
42
|
|
|
37
43
|
__all__: PyLegendSequence[str] = [
|
|
38
44
|
"__version__",
|
|
39
45
|
|
|
40
|
-
"
|
|
41
|
-
"
|
|
46
|
+
"LegacyApiTdsClient",
|
|
47
|
+
"legacy_api_tds_client",
|
|
42
48
|
|
|
43
49
|
"LegendClient",
|
|
44
50
|
"AuthScheme",
|
|
45
51
|
"LocalhostEmptyAuthScheme",
|
|
46
52
|
"HeaderTokenAuthScheme",
|
|
53
|
+
"CookieAuthScheme",
|
|
47
54
|
"ResponseReader",
|
|
48
55
|
|
|
49
56
|
"VersionedProjectCoordinates",
|
|
@@ -51,6 +58,9 @@ __all__: PyLegendSequence[str] = [
|
|
|
51
58
|
"GroupWorkspaceProjectCoordinates",
|
|
52
59
|
|
|
53
60
|
"agg",
|
|
61
|
+
"now",
|
|
62
|
+
"today",
|
|
63
|
+
"current_user",
|
|
54
64
|
]
|
|
55
65
|
|
|
56
66
|
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
|
|
15
15
|
from pylegend._typing import PyLegendSequence
|
|
16
|
-
from pylegend.core.
|
|
17
|
-
from pylegend.core.
|
|
18
|
-
from pylegend.core.
|
|
16
|
+
from pylegend.core.database.sql_to_string.generator import SqlToStringGenerator
|
|
17
|
+
from pylegend.core.database.sql_to_string.config import SqlToStringConfig, SqlToStringFormat
|
|
18
|
+
from pylegend.core.database.sql_to_string.db_extension import SqlToStringDbExtension
|
|
19
19
|
|
|
20
20
|
__all__: PyLegendSequence[str] = [
|
|
21
21
|
"SqlToStringGenerator",
|
|
@@ -18,7 +18,7 @@ from pylegend._typing import (
|
|
|
18
18
|
PyLegendList,
|
|
19
19
|
PyLegendSequence
|
|
20
20
|
)
|
|
21
|
-
from pylegend.core.
|
|
21
|
+
from pylegend.core.database.sql_to_string.config import SqlToStringConfig
|
|
22
22
|
from pylegend.core.sql.metamodel import (
|
|
23
23
|
QuerySpecification,
|
|
24
24
|
Select,
|
|
@@ -130,6 +130,8 @@ from pylegend.core.sql.metamodel_extension import (
|
|
|
130
130
|
MinuteExpression,
|
|
131
131
|
SecondExpression,
|
|
132
132
|
EpochExpression,
|
|
133
|
+
WindowExpression,
|
|
134
|
+
ConstantExpression,
|
|
133
135
|
)
|
|
134
136
|
|
|
135
137
|
|
|
@@ -448,6 +450,10 @@ def expression_processor(
|
|
|
448
450
|
return extension.process_second_expression(expression, config)
|
|
449
451
|
elif isinstance(expression, EpochExpression):
|
|
450
452
|
return extension.process_epoch_expression(expression, config)
|
|
453
|
+
elif isinstance(expression, WindowExpression):
|
|
454
|
+
return extension.process_window_expression(expression, config)
|
|
455
|
+
elif isinstance(expression, ConstantExpression):
|
|
456
|
+
return expression.name
|
|
451
457
|
|
|
452
458
|
else:
|
|
453
459
|
raise ValueError("Unsupported expression type: " + str(type(expression))) # pragma: no cover
|
|
@@ -674,7 +680,7 @@ def function_call_processor(
|
|
|
674
680
|
|
|
675
681
|
window = ""
|
|
676
682
|
if function_call.window:
|
|
677
|
-
window = "
|
|
683
|
+
window = " " + extension.process_window(function_call.window, config)
|
|
678
684
|
|
|
679
685
|
first_sep = config.format.separator(1) if function_call.arguments else ""
|
|
680
686
|
sep0 = config.format.separator(0) if function_call.arguments else ""
|
|
@@ -838,14 +844,14 @@ def window_processor(
|
|
|
838
844
|
if window.windowRef:
|
|
839
845
|
return window.windowRef
|
|
840
846
|
|
|
841
|
-
partitions = "
|
|
847
|
+
partitions = "PARTITION BY " + (", ".join([extension.process_expression(e, config) for e in window.partitions])) \
|
|
842
848
|
if window.partitions else ""
|
|
843
849
|
|
|
844
|
-
order_by = "
|
|
850
|
+
order_by = "ORDER BY " + (", ".join([extension.process_sort_item(o, config) for o in window.orderBy])) \
|
|
845
851
|
if window.orderBy else ""
|
|
846
852
|
|
|
847
853
|
# TODO: Handle window frame
|
|
848
|
-
return f"{partitions}{order_by}{''}"
|
|
854
|
+
return f"OVER ({partitions}{' ' if (partitions != '') and (order_by != '') else ''}{order_by}){''}"
|
|
849
855
|
|
|
850
856
|
|
|
851
857
|
def table_function_processor(
|
|
@@ -1162,6 +1168,9 @@ class SqlToStringDbExtension:
|
|
|
1162
1168
|
def process_epoch_expression(self, expr: EpochExpression, config: SqlToStringConfig) -> str:
|
|
1163
1169
|
return f"DATE_PART('epoch', {self.process_expression(expr.value, config)})"
|
|
1164
1170
|
|
|
1171
|
+
def process_window_expression(self, expr: WindowExpression, config: SqlToStringConfig) -> str:
|
|
1172
|
+
return f"{self.process_expression(expr.nested, config)} {self.process_window(expr.window, config)}"
|
|
1173
|
+
|
|
1165
1174
|
def process_qualified_name(self, qualified_name: QualifiedName, config: SqlToStringConfig) -> str:
|
|
1166
1175
|
return qualified_name_processor(qualified_name, self, config)
|
|
1167
1176
|
|
|
@@ -18,8 +18,8 @@ from pylegend._typing import (
|
|
|
18
18
|
PyLegendDict
|
|
19
19
|
)
|
|
20
20
|
from pylegend.utils.class_utils import find_sub_classes
|
|
21
|
-
from pylegend.core.
|
|
22
|
-
from pylegend.core.
|
|
21
|
+
from pylegend.core.database.sql_to_string.config import SqlToStringConfig
|
|
22
|
+
from pylegend.core.database.sql_to_string.db_extension import SqlToStringDbExtension
|
|
23
23
|
from pylegend.core.sql.metamodel import QuerySpecification
|
|
24
24
|
|
|
25
25
|
__all__: PyLegendSequence[str] = [
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
from pylegend._typing import (
|
|
16
16
|
PyLegendSequence,
|
|
17
17
|
)
|
|
18
|
-
from pylegend.core.language.primitives import (
|
|
18
|
+
from pylegend.core.language.shared.primitives import (
|
|
19
19
|
PyLegendPrimitive,
|
|
20
20
|
PyLegendPrimitiveOrPythonPrimitive,
|
|
21
21
|
PyLegendBoolean,
|
|
@@ -27,7 +27,7 @@ from pylegend.core.language.primitives import (
|
|
|
27
27
|
PyLegendDateTime,
|
|
28
28
|
PyLegendStrictDate,
|
|
29
29
|
)
|
|
30
|
-
from pylegend.core.language.expression import (
|
|
30
|
+
from pylegend.core.language.shared.expression import (
|
|
31
31
|
PyLegendExpressionBooleanReturn,
|
|
32
32
|
PyLegendExpressionStringReturn,
|
|
33
33
|
PyLegendExpressionNumberReturn,
|
|
@@ -37,7 +37,7 @@ from pylegend.core.language.expression import (
|
|
|
37
37
|
PyLegendExpressionDateTimeReturn,
|
|
38
38
|
PyLegendExpressionStrictDateReturn,
|
|
39
39
|
)
|
|
40
|
-
from pylegend.core.language.literal_expressions import (
|
|
40
|
+
from pylegend.core.language.shared.literal_expressions import (
|
|
41
41
|
PyLegendBooleanLiteralExpression,
|
|
42
42
|
PyLegendStringLiteralExpression,
|
|
43
43
|
PyLegendIntegerLiteralExpression,
|
|
@@ -46,7 +46,7 @@ from pylegend.core.language.literal_expressions import (
|
|
|
46
46
|
PyLegendStrictDateLiteralExpression,
|
|
47
47
|
convert_literal_to_literal_expression,
|
|
48
48
|
)
|
|
49
|
-
from pylegend.core.language.column_expressions import (
|
|
49
|
+
from pylegend.core.language.shared.column_expressions import (
|
|
50
50
|
PyLegendColumnExpression,
|
|
51
51
|
PyLegendBooleanColumnExpression,
|
|
52
52
|
PyLegendStringColumnExpression,
|
|
@@ -57,9 +57,9 @@ from pylegend.core.language.column_expressions import (
|
|
|
57
57
|
PyLegendDateTimeColumnExpression,
|
|
58
58
|
PyLegendStrictDateColumnExpression,
|
|
59
59
|
)
|
|
60
|
-
from pylegend.core.language.
|
|
61
|
-
from pylegend.core.language.aggregate_specification import
|
|
62
|
-
from pylegend.core.language.primitive_collection import (
|
|
60
|
+
from pylegend.core.language.legacy_api.legacy_api_tds_row import LegacyApiTdsRow
|
|
61
|
+
from pylegend.core.language.legacy_api.aggregate_specification import LegacyApiAggregateSpecification, agg
|
|
62
|
+
from pylegend.core.language.shared.primitive_collection import (
|
|
63
63
|
PyLegendPrimitiveCollection,
|
|
64
64
|
PyLegendIntegerCollection,
|
|
65
65
|
PyLegendFloatCollection,
|
|
@@ -71,9 +71,10 @@ from pylegend.core.language.primitive_collection import (
|
|
|
71
71
|
PyLegendStrictDateCollection,
|
|
72
72
|
create_primitive_collection,
|
|
73
73
|
)
|
|
74
|
-
from pylegend.core.language.functions import (
|
|
74
|
+
from pylegend.core.language.shared.functions import (
|
|
75
75
|
today,
|
|
76
76
|
now,
|
|
77
|
+
current_user,
|
|
77
78
|
)
|
|
78
79
|
|
|
79
80
|
__all__: PyLegendSequence[str] = [
|
|
@@ -115,8 +116,8 @@ __all__: PyLegendSequence[str] = [
|
|
|
115
116
|
"PyLegendStrictDateLiteralExpression",
|
|
116
117
|
"convert_literal_to_literal_expression",
|
|
117
118
|
|
|
118
|
-
"
|
|
119
|
-
"
|
|
119
|
+
"LegacyApiTdsRow",
|
|
120
|
+
"LegacyApiAggregateSpecification",
|
|
120
121
|
"agg",
|
|
121
122
|
|
|
122
123
|
"PyLegendPrimitiveCollection",
|
|
@@ -132,4 +133,5 @@ __all__: PyLegendSequence[str] = [
|
|
|
132
133
|
|
|
133
134
|
"today",
|
|
134
135
|
"now",
|
|
136
|
+
"current_user",
|
|
135
137
|
]
|
|
@@ -0,0 +1,13 @@
|
|
|
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.
|
|
@@ -16,27 +16,27 @@ from pylegend._typing import (
|
|
|
16
16
|
PyLegendSequence,
|
|
17
17
|
PyLegendCallable
|
|
18
18
|
)
|
|
19
|
-
from pylegend.core.language.primitive_collection import PyLegendPrimitiveCollection
|
|
19
|
+
from pylegend.core.language.shared.primitive_collection import PyLegendPrimitiveCollection
|
|
20
20
|
from pylegend.core.language import (
|
|
21
|
-
|
|
21
|
+
LegacyApiTdsRow,
|
|
22
22
|
PyLegendPrimitive,
|
|
23
23
|
PyLegendPrimitiveOrPythonPrimitive,
|
|
24
24
|
)
|
|
25
25
|
|
|
26
26
|
__all__: PyLegendSequence[str] = [
|
|
27
|
-
"
|
|
27
|
+
"LegacyApiAggregateSpecification",
|
|
28
28
|
"agg",
|
|
29
29
|
]
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
class
|
|
33
|
-
__map_fn: PyLegendCallable[[
|
|
32
|
+
class LegacyApiAggregateSpecification:
|
|
33
|
+
__map_fn: PyLegendCallable[[LegacyApiTdsRow], PyLegendPrimitiveOrPythonPrimitive]
|
|
34
34
|
__aggregate_fn: PyLegendCallable[[PyLegendPrimitiveCollection], PyLegendPrimitive]
|
|
35
35
|
__name: str
|
|
36
36
|
|
|
37
37
|
def __init__(
|
|
38
38
|
self,
|
|
39
|
-
map_fn: PyLegendCallable[[
|
|
39
|
+
map_fn: PyLegendCallable[[LegacyApiTdsRow], PyLegendPrimitiveOrPythonPrimitive],
|
|
40
40
|
aggregate_fn: PyLegendCallable[[PyLegendPrimitiveCollection], PyLegendPrimitive],
|
|
41
41
|
name: str
|
|
42
42
|
) -> None:
|
|
@@ -47,7 +47,7 @@ class AggregateSpecification:
|
|
|
47
47
|
def get_name(self) -> str:
|
|
48
48
|
return self.__name
|
|
49
49
|
|
|
50
|
-
def get_map_fn(self) -> PyLegendCallable[[
|
|
50
|
+
def get_map_fn(self) -> PyLegendCallable[[LegacyApiTdsRow], PyLegendPrimitiveOrPythonPrimitive]:
|
|
51
51
|
return self.__map_fn
|
|
52
52
|
|
|
53
53
|
def get_aggregate_fn(self) -> PyLegendCallable[[PyLegendPrimitiveCollection], PyLegendPrimitive]:
|
|
@@ -55,8 +55,8 @@ class AggregateSpecification:
|
|
|
55
55
|
|
|
56
56
|
|
|
57
57
|
def agg(
|
|
58
|
-
map_fn: PyLegendCallable[[
|
|
58
|
+
map_fn: PyLegendCallable[[LegacyApiTdsRow], PyLegendPrimitiveOrPythonPrimitive],
|
|
59
59
|
aggregate_fn: PyLegendCallable[[PyLegendPrimitiveCollection], PyLegendPrimitive],
|
|
60
60
|
name: str
|
|
61
|
-
) ->
|
|
62
|
-
return
|
|
61
|
+
) -> LegacyApiAggregateSpecification:
|
|
62
|
+
return LegacyApiAggregateSpecification(map_fn=map_fn, aggregate_fn=aggregate_fn, name=name)
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Copyright 2023 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.language.shared.tds_row import AbstractTdsRow
|
|
19
|
+
from pylegend.core.tds.tds_frame import PyLegendTdsFrame
|
|
20
|
+
|
|
21
|
+
__all__: PyLegendSequence[str] = [
|
|
22
|
+
"LegacyApiTdsRow",
|
|
23
|
+
]
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class LegacyApiTdsRow(AbstractTdsRow):
|
|
27
|
+
def __init__(self, frame_name: str, frame: PyLegendTdsFrame) -> None:
|
|
28
|
+
super().__init__(frame_name, frame)
|
|
29
|
+
|
|
30
|
+
@staticmethod
|
|
31
|
+
def from_tds_frame(frame_name: str, frame: PyLegendTdsFrame) -> "LegacyApiTdsRow":
|
|
32
|
+
return LegacyApiTdsRow(frame_name=frame_name, frame=frame)
|
|
@@ -0,0 +1,13 @@
|
|
|
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.
|