pylegend 0.3.0__py3-none-any.whl → 0.5.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.
Files changed (124) hide show
  1. pylegend/__init__.py +16 -6
  2. pylegend/core/{databse → database}/sql_to_string/__init__.py +3 -3
  3. pylegend/core/{databse → database}/sql_to_string/db_extension.py +14 -5
  4. pylegend/core/{databse → database}/sql_to_string/generator.py +2 -2
  5. pylegend/core/language/__init__.py +12 -10
  6. pylegend/core/language/legacy_api/__init__.py +13 -0
  7. pylegend/core/language/{aggregate_specification.py → legacy_api/aggregate_specification.py} +10 -10
  8. pylegend/core/language/legacy_api/legacy_api_tds_row.py +32 -0
  9. pylegend/core/language/legendql_api/__init__.py +13 -0
  10. pylegend/core/language/legendql_api/legendql_api_custom_expressions.py +541 -0
  11. pylegend/core/language/legendql_api/legendql_api_tds_row.py +292 -0
  12. pylegend/core/language/shared/__init__.py +13 -0
  13. pylegend/core/language/{column_expressions.py → shared/column_expressions.py} +32 -31
  14. pylegend/core/language/{expression.py → shared/expression.py} +8 -0
  15. pylegend/core/language/{functions.py → shared/functions.py} +12 -3
  16. pylegend/core/language/shared/helpers.py +75 -0
  17. pylegend/core/language/{literal_expressions.py → shared/literal_expressions.py} +39 -1
  18. pylegend/core/language/{operations → shared/operations}/binary_expression.py +34 -2
  19. pylegend/core/language/{operations → shared/operations}/boolean_operation_expressions.py +34 -6
  20. pylegend/core/language/{operations → shared/operations}/collection_operation_expressions.py +146 -26
  21. pylegend/core/language/{operations → shared/operations}/date_operation_expressions.py +288 -24
  22. pylegend/core/language/{operations → shared/operations}/float_operation_expressions.py +53 -8
  23. pylegend/core/language/{operations → shared/operations}/integer_operation_expressions.py +62 -9
  24. pylegend/core/language/{operations → shared/operations}/nullary_expression.py +9 -2
  25. pylegend/core/language/{operations → shared/operations}/number_operation_expressions.py +211 -30
  26. pylegend/core/language/shared/operations/primitive_operation_expressions.py +155 -0
  27. pylegend/core/language/{operations → shared/operations}/string_operation_expressions.py +194 -21
  28. pylegend/core/language/{operations → shared/operations}/unary_expression.py +10 -2
  29. pylegend/core/language/{primitive_collection.py → shared/primitive_collection.py} +2 -2
  30. pylegend/core/language/{primitives → shared/primitives}/__init__.py +9 -9
  31. pylegend/core/language/{primitives → shared/primitives}/boolean.py +9 -5
  32. pylegend/core/language/{primitives → shared/primitives}/date.py +60 -15
  33. pylegend/core/language/{primitives → shared/primitives}/datetime.py +4 -5
  34. pylegend/core/language/{primitives → shared/primitives}/float.py +6 -6
  35. pylegend/core/language/{primitives → shared/primitives}/integer.py +6 -6
  36. pylegend/core/language/{primitives → shared/primitives}/number.py +16 -13
  37. pylegend/core/language/{primitives → shared/primitives}/primitive.py +41 -5
  38. pylegend/core/language/{primitives → shared/primitives}/strictdate.py +4 -5
  39. pylegend/core/language/{primitives → shared/primitives}/string.py +18 -19
  40. pylegend/core/language/{tds_row.py → shared/tds_row.py} +46 -16
  41. pylegend/core/request/__init__.py +7 -1
  42. pylegend/core/request/auth.py +55 -1
  43. pylegend/core/request/legend_client.py +32 -0
  44. pylegend/core/sql/metamodel_extension.py +28 -0
  45. pylegend/core/tds/abstract/__init__.py +13 -0
  46. pylegend/core/tds/abstract/frames/__init__.py +13 -0
  47. pylegend/core/tds/{legend_api/frames/legend_api_applied_function_tds_frame.py → abstract/frames/applied_function_tds_frame.py} +19 -13
  48. pylegend/core/tds/abstract/frames/base_tds_frame.py +125 -0
  49. pylegend/core/tds/{legend_api/frames/legend_api_input_tds_frame.py → abstract/frames/input_tds_frame.py} +9 -12
  50. pylegend/core/tds/{legend_api/frames/functions → abstract}/function_helpers.py +1 -1
  51. pylegend/core/tds/{legend_api/frames/functions/concatenate_function.py → legacy_api/frames/functions/legacy_api_concatenate_function.py} +25 -13
  52. pylegend/core/tds/{legend_api/frames/functions/distinct_function.py → legacy_api/frames/functions/legacy_api_distinct_function.py} +13 -8
  53. pylegend/core/tds/{legend_api/frames/functions/drop_function.py → legacy_api/frames/functions/legacy_api_drop_function.py} +13 -8
  54. pylegend/core/tds/{legend_api/frames/functions/extend_function.py → legacy_api/frames/functions/legacy_api_extend_function.py} +36 -16
  55. pylegend/core/tds/{legend_api/frames/functions/filter_function.py → legacy_api/frames/functions/legacy_api_filter_function.py} +25 -13
  56. pylegend/core/tds/{legend_api/frames/functions/group_by_function.py → legacy_api/frames/functions/legacy_api_group_by_function.py} +44 -17
  57. pylegend/core/tds/{legend_api/frames/functions/head_function.py → legacy_api/frames/functions/legacy_api_head_function.py} +13 -8
  58. pylegend/core/tds/{legend_api/frames/functions/join_by_columns_function.py → legacy_api/frames/functions/legacy_api_join_by_columns_function.py} +40 -13
  59. pylegend/core/tds/{legend_api/frames/functions/join_function.py → legacy_api/frames/functions/legacy_api_join_function.py} +44 -20
  60. pylegend/core/tds/{legend_api/frames/functions/rename_columns_function.py → legacy_api/frames/functions/legacy_api_rename_columns_function.py} +20 -8
  61. pylegend/core/tds/{legend_api/frames/functions/restrict_function.py → legacy_api/frames/functions/legacy_api_restrict_function.py} +17 -8
  62. pylegend/core/tds/{legend_api/frames/functions/slice_function.py → legacy_api/frames/functions/legacy_api_slice_function.py} +13 -8
  63. pylegend/core/tds/{legend_api/frames/functions/sort_function.py → legacy_api/frames/functions/legacy_api_sort_function.py} +19 -8
  64. pylegend/core/tds/legacy_api/frames/legacy_api_applied_function_tds_frame.py +37 -0
  65. pylegend/core/tds/legacy_api/frames/legacy_api_base_tds_frame.py +204 -0
  66. pylegend/core/tds/legacy_api/frames/legacy_api_input_tds_frame.py +51 -0
  67. pylegend/core/tds/{legend_api/frames/legend_api_tds_frame.py → legacy_api/frames/legacy_api_tds_frame.py} +28 -28
  68. pylegend/core/tds/legendql_api/__init__.py +13 -0
  69. pylegend/core/tds/legendql_api/frames/__init__.py +13 -0
  70. pylegend/core/tds/legendql_api/frames/functions/__init__.py +13 -0
  71. pylegend/core/tds/legendql_api/frames/functions/legendql_api_asofjoin_function.py +156 -0
  72. pylegend/core/tds/legendql_api/frames/functions/legendql_api_concatenate_function.py +139 -0
  73. pylegend/core/tds/legendql_api/frames/functions/legendql_api_distinct_function.py +69 -0
  74. pylegend/core/tds/legendql_api/frames/functions/legendql_api_drop_function.py +74 -0
  75. pylegend/core/tds/legendql_api/frames/functions/legendql_api_extend_function.py +256 -0
  76. pylegend/core/tds/legendql_api/frames/functions/legendql_api_filter_function.py +121 -0
  77. pylegend/core/tds/legendql_api/frames/functions/legendql_api_function_helpers.py +137 -0
  78. pylegend/core/tds/legendql_api/frames/functions/legendql_api_groupby_function.py +256 -0
  79. pylegend/core/tds/legendql_api/frames/functions/legendql_api_head_function.py +74 -0
  80. pylegend/core/tds/legendql_api/frames/functions/legendql_api_join_function.py +214 -0
  81. pylegend/core/tds/legendql_api/frames/functions/legendql_api_project_function.py +169 -0
  82. pylegend/core/tds/legendql_api/frames/functions/legendql_api_rename_function.py +189 -0
  83. pylegend/core/tds/legendql_api/frames/functions/legendql_api_select_function.py +131 -0
  84. pylegend/core/tds/legendql_api/frames/functions/legendql_api_slice_function.py +82 -0
  85. pylegend/core/tds/legendql_api/frames/functions/legendql_api_sort_function.py +93 -0
  86. pylegend/core/tds/legendql_api/frames/functions/legendql_api_window_extend_function.py +283 -0
  87. pylegend/core/tds/legendql_api/frames/legendql_api_applied_function_tds_frame.py +37 -0
  88. pylegend/core/tds/legendql_api/frames/legendql_api_base_tds_frame.py +419 -0
  89. pylegend/core/tds/legendql_api/frames/legendql_api_input_tds_frame.py +50 -0
  90. pylegend/core/tds/legendql_api/frames/legendql_api_tds_frame.py +327 -0
  91. pylegend/core/tds/pandas_api/frames/functions/assign_function.py +6 -6
  92. pylegend/core/tds/pandas_api/frames/pandas_api_applied_function_tds_frame.py +4 -0
  93. pylegend/core/tds/pandas_api/frames/pandas_api_base_tds_frame.py +11 -3
  94. pylegend/core/tds/pandas_api/frames/pandas_api_tds_frame.py +2 -2
  95. pylegend/core/tds/tds_frame.py +32 -2
  96. pylegend/extensions/database/vendors/postgres/postgres_sql_to_string.py +1 -1
  97. pylegend/extensions/tds/abstract/legend_function_input_frame.py +4 -0
  98. pylegend/extensions/tds/abstract/legend_service_input_frame.py +4 -0
  99. pylegend/extensions/tds/abstract/table_spec_input_frame.py +4 -0
  100. pylegend/extensions/tds/{legend_api/frames/legend_api_legend_function_input_frame.py → legacy_api/frames/legacy_api_legend_function_input_frame.py} +5 -5
  101. pylegend/extensions/tds/{legend_api/frames/legend_api_legend_service_input_frame.py → legacy_api/frames/legacy_api_legend_service_input_frame.py} +6 -6
  102. pylegend/extensions/tds/{legend_api/frames/legend_api_table_spec_input_frame.py → legacy_api/frames/legacy_api_table_spec_input_frame.py} +5 -5
  103. pylegend/extensions/tds/legendql_api/__init__.py +13 -0
  104. pylegend/extensions/tds/legendql_api/frames/__init__.py +13 -0
  105. pylegend/extensions/tds/legendql_api/frames/legendql_api_legend_service_input_frame.py +46 -0
  106. pylegend/extensions/tds/legendql_api/frames/legendql_api_table_spec_input_frame.py +36 -0
  107. pylegend/{legend_api_tds_client.py → legacy_api_tds_client.py} +15 -15
  108. {pylegend-0.3.0.dist-info → pylegend-0.5.0.dist-info}/METADATA +7 -8
  109. pylegend-0.5.0.dist-info/NOTICE +5 -0
  110. pylegend-0.5.0.dist-info/RECORD +155 -0
  111. {pylegend-0.3.0.dist-info → pylegend-0.5.0.dist-info}/WHEEL +1 -1
  112. pylegend/core/language/operations/primitive_operation_expressions.py +0 -56
  113. pylegend/core/tds/legend_api/frames/legend_api_base_tds_frame.py +0 -294
  114. pylegend-0.3.0.dist-info/RECORD +0 -115
  115. /pylegend/core/{databse → database}/__init__.py +0 -0
  116. /pylegend/core/{databse → database}/sql_to_string/config.py +0 -0
  117. /pylegend/core/language/{operations → shared/operations}/__init__.py +0 -0
  118. /pylegend/core/tds/{legend_api → legacy_api}/__init__.py +0 -0
  119. /pylegend/core/tds/{legend_api → legacy_api}/frames/__init__.py +0 -0
  120. /pylegend/core/tds/{legend_api → legacy_api}/frames/functions/__init__.py +0 -0
  121. /pylegend/extensions/tds/{legend_api → legacy_api}/__init__.py +0 -0
  122. /pylegend/extensions/tds/{legend_api → legacy_api}/frames/__init__.py +0 -0
  123. {pylegend-0.3.0.dist-info → pylegend-0.5.0.dist-info}/LICENSE +0 -0
  124. {pylegend-0.3.0.dist-info → pylegend-0.5.0.dist-info}/LICENSE.spdx +0 -0
@@ -1,294 +0,0 @@
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 abc import ABCMeta, abstractmethod
16
- import pandas as pd
17
- from pylegend._typing import (
18
- PyLegendSequence,
19
- PyLegendTypeVar,
20
- PyLegendList,
21
- PyLegendOptional,
22
- PyLegendCallable,
23
- PyLegendUnion,
24
- )
25
- from pylegend.core.sql.metamodel import QuerySpecification
26
- from pylegend.core.databse.sql_to_string import (
27
- SqlToStringConfig,
28
- SqlToStringFormat
29
- )
30
- from pylegend.core.tds.tds_column import TdsColumn
31
- from pylegend.core.tds.tds_frame import FrameToSqlConfig
32
- from pylegend.core.tds.legend_api.frames.legend_api_tds_frame import LegendApiTdsFrame
33
- from pylegend.core.tds.result_handler import (
34
- ResultHandler,
35
- ToStringResultHandler,
36
- )
37
- from pylegend.extensions.tds.result_handler import (
38
- ToPandasDfResultHandler,
39
- PandasDfReadConfig,
40
- )
41
- from pylegend.core.language import (
42
- TdsRow,
43
- PyLegendBoolean,
44
- PyLegendPrimitiveOrPythonPrimitive,
45
- AggregateSpecification,
46
- )
47
-
48
- __all__: PyLegendSequence[str] = [
49
- "LegendApiBaseTdsFrame"
50
- ]
51
-
52
- R = PyLegendTypeVar('R')
53
-
54
-
55
- class LegendApiBaseTdsFrame(LegendApiTdsFrame, metaclass=ABCMeta):
56
- __columns: PyLegendSequence[TdsColumn]
57
-
58
- def __init__(self, columns: PyLegendSequence[TdsColumn]) -> None:
59
- col_names = [c.get_name() for c in columns]
60
- if len(col_names) != len(set(col_names)):
61
- cols = "[" + ", ".join([str(c) for c in columns]) + "]"
62
- raise ValueError(f"TdsFrame cannot have duplicated column names. Passed columns: {cols}")
63
- self.__columns = [c.copy() for c in columns]
64
-
65
- def columns(self) -> PyLegendSequence[TdsColumn]:
66
- return [c.copy() for c in self.__columns]
67
-
68
- def head(self, row_count: int = 5) -> "LegendApiTdsFrame":
69
- from pylegend.core.tds.legend_api.frames.legend_api_applied_function_tds_frame import (
70
- LegendApiAppliedFunctionTdsFrame
71
- )
72
- from pylegend.core.tds.legend_api.frames.functions.head_function import (
73
- HeadFunction
74
- )
75
- return LegendApiAppliedFunctionTdsFrame(HeadFunction(self, row_count))
76
-
77
- def take(self, row_count: int = 5) -> "LegendApiTdsFrame":
78
- return self.head(row_count=row_count)
79
-
80
- def limit(self, row_count: int = 5) -> "LegendApiTdsFrame":
81
- return self.head(row_count=row_count)
82
-
83
- def drop(self, row_count: int = 5) -> "LegendApiTdsFrame":
84
- from pylegend.core.tds.legend_api.frames.legend_api_applied_function_tds_frame import (
85
- LegendApiAppliedFunctionTdsFrame
86
- )
87
- from pylegend.core.tds.legend_api.frames.functions.drop_function import (
88
- DropFunction
89
- )
90
- return LegendApiAppliedFunctionTdsFrame(DropFunction(self, row_count))
91
-
92
- def slice(self, start_row: int, end_row_exclusive: int) -> "LegendApiTdsFrame":
93
- from pylegend.core.tds.legend_api.frames.legend_api_applied_function_tds_frame import (
94
- LegendApiAppliedFunctionTdsFrame
95
- )
96
- from pylegend.core.tds.legend_api.frames.functions.slice_function import (
97
- SliceFunction
98
- )
99
- return LegendApiAppliedFunctionTdsFrame(SliceFunction(self, start_row, end_row_exclusive))
100
-
101
- def distinct(self) -> "LegendApiTdsFrame":
102
- from pylegend.core.tds.legend_api.frames.legend_api_applied_function_tds_frame import (
103
- LegendApiAppliedFunctionTdsFrame
104
- )
105
- from pylegend.core.tds.legend_api.frames.functions.distinct_function import (
106
- DistinctFunction
107
- )
108
- return LegendApiAppliedFunctionTdsFrame(DistinctFunction(self))
109
-
110
- def restrict(self, column_name_list: PyLegendList[str]) -> "LegendApiTdsFrame":
111
- from pylegend.core.tds.legend_api.frames.legend_api_applied_function_tds_frame import (
112
- LegendApiAppliedFunctionTdsFrame
113
- )
114
- from pylegend.core.tds.legend_api.frames.functions.restrict_function import (
115
- RestrictFunction
116
- )
117
- return LegendApiAppliedFunctionTdsFrame(RestrictFunction(self, column_name_list))
118
-
119
- def sort(
120
- self,
121
- column_name_list: PyLegendList[str],
122
- direction_list: PyLegendOptional[PyLegendList[str]] = None
123
- ) -> "LegendApiTdsFrame":
124
- from pylegend.core.tds.legend_api.frames.legend_api_applied_function_tds_frame import (
125
- LegendApiAppliedFunctionTdsFrame
126
- )
127
- from pylegend.core.tds.legend_api.frames.functions.sort_function import (
128
- SortFunction
129
- )
130
- return LegendApiAppliedFunctionTdsFrame(SortFunction(self, column_name_list, direction_list))
131
-
132
- def concatenate(self, other: "LegendApiTdsFrame") -> "LegendApiTdsFrame":
133
- from pylegend.core.tds.legend_api.frames.legend_api_applied_function_tds_frame import (
134
- LegendApiAppliedFunctionTdsFrame
135
- )
136
- from pylegend.core.tds.legend_api.frames.functions.concatenate_function import (
137
- ConcatenateFunction
138
- )
139
- return LegendApiAppliedFunctionTdsFrame(ConcatenateFunction(self, other))
140
-
141
- def rename_columns(
142
- self,
143
- column_names: PyLegendList[str],
144
- renamed_column_names: PyLegendList[str]
145
- ) -> "LegendApiTdsFrame":
146
- from pylegend.core.tds.legend_api.frames.legend_api_applied_function_tds_frame import (
147
- LegendApiAppliedFunctionTdsFrame
148
- )
149
- from pylegend.core.tds.legend_api.frames.functions.rename_columns_function import (
150
- RenameColumnsFunction
151
- )
152
- return LegendApiAppliedFunctionTdsFrame(RenameColumnsFunction(self, column_names, renamed_column_names))
153
-
154
- def filter(
155
- self,
156
- filter_function: PyLegendCallable[[TdsRow], PyLegendUnion[bool, PyLegendBoolean]]
157
- ) -> "LegendApiTdsFrame":
158
- from pylegend.core.tds.legend_api.frames.legend_api_applied_function_tds_frame import (
159
- LegendApiAppliedFunctionTdsFrame
160
- )
161
- from pylegend.core.tds.legend_api.frames.functions.filter_function import (
162
- FilterFunction
163
- )
164
- return LegendApiAppliedFunctionTdsFrame(FilterFunction(self, filter_function))
165
-
166
- def extend(
167
- self,
168
- functions_list: PyLegendList[PyLegendCallable[[TdsRow], PyLegendPrimitiveOrPythonPrimitive]],
169
- column_names_list: PyLegendList[str]
170
- ) -> "LegendApiTdsFrame":
171
- from pylegend.core.tds.legend_api.frames.legend_api_applied_function_tds_frame import (
172
- LegendApiAppliedFunctionTdsFrame
173
- )
174
- from pylegend.core.tds.legend_api.frames.functions.extend_function import (
175
- ExtendFunction
176
- )
177
- return LegendApiAppliedFunctionTdsFrame(ExtendFunction(self, functions_list, column_names_list))
178
-
179
- def join(
180
- self,
181
- other: "LegendApiTdsFrame",
182
- join_condition: PyLegendCallable[[TdsRow, TdsRow], PyLegendUnion[bool, PyLegendBoolean]],
183
- join_type: str = 'LEFT_OUTER'
184
- ) -> "LegendApiTdsFrame":
185
- from pylegend.core.tds.legend_api.frames.legend_api_applied_function_tds_frame import (
186
- LegendApiAppliedFunctionTdsFrame
187
- )
188
- from pylegend.core.tds.legend_api.frames.functions.join_function import (
189
- JoinFunction
190
- )
191
- return LegendApiAppliedFunctionTdsFrame(
192
- JoinFunction(self, other, join_condition, join_type)
193
- )
194
-
195
- def join_by_columns(
196
- self,
197
- other: "LegendApiTdsFrame",
198
- self_columns: PyLegendList[str],
199
- other_columns: PyLegendList[str],
200
- join_type: str = 'LEFT_OUTER'
201
- ) -> "LegendApiTdsFrame":
202
- from pylegend.core.tds.legend_api.frames.legend_api_applied_function_tds_frame import (
203
- LegendApiAppliedFunctionTdsFrame
204
- )
205
- from pylegend.core.tds.legend_api.frames.functions.join_by_columns_function import (
206
- JoinByColumnsFunction
207
- )
208
- return LegendApiAppliedFunctionTdsFrame(
209
- JoinByColumnsFunction(self, other, self_columns, other_columns, join_type)
210
- )
211
-
212
- def group_by(
213
- self,
214
- grouping_columns: PyLegendList[str],
215
- aggregations: PyLegendList[AggregateSpecification],
216
- ) -> "LegendApiTdsFrame":
217
- from pylegend.core.tds.legend_api.frames.legend_api_applied_function_tds_frame import (
218
- LegendApiAppliedFunctionTdsFrame
219
- )
220
- from pylegend.core.tds.legend_api.frames.functions.group_by_function import (
221
- GroupByFunction
222
- )
223
- return LegendApiAppliedFunctionTdsFrame(
224
- GroupByFunction(self, grouping_columns, aggregations)
225
- )
226
-
227
- @abstractmethod
228
- def to_sql_query_object(self, config: FrameToSqlConfig) -> QuerySpecification:
229
- pass # pragma: no cover
230
-
231
- @abstractmethod
232
- def get_all_tds_frames(self) -> PyLegendList["LegendApiBaseTdsFrame"]:
233
- pass # pragma: no cover
234
-
235
- def to_sql_query(self, config: FrameToSqlConfig = FrameToSqlConfig()) -> str:
236
- query = self.to_sql_query_object(config)
237
- sql_to_string_config = SqlToStringConfig(
238
- format_=SqlToStringFormat(
239
- pretty=config.pretty
240
- )
241
- )
242
- return config.sql_to_string_generator().generate_sql_string(query, sql_to_string_config)
243
-
244
- def execute_frame(
245
- self,
246
- result_handler: ResultHandler[R],
247
- chunk_size: PyLegendOptional[int] = None
248
- ) -> R:
249
- from pylegend.core.tds.legend_api.frames.legend_api_input_tds_frame import (
250
- LegendApiInputTdsFrame,
251
- LegendApiExecutableInputTdsFrame
252
- )
253
-
254
- tds_frames = self.get_all_tds_frames()
255
- input_frames = [x for x in tds_frames if isinstance(x, LegendApiInputTdsFrame)]
256
-
257
- non_exec_frames = [x for x in input_frames if not isinstance(x, LegendApiExecutableInputTdsFrame)]
258
- if non_exec_frames:
259
- raise ValueError(
260
- "Cannot execute frame as its built on top of non-executable input frames: [" +
261
- (", ".join([str(f) for f in non_exec_frames]) + "]")
262
- )
263
-
264
- exec_frames = [x for x in input_frames if isinstance(x, LegendApiExecutableInputTdsFrame)]
265
-
266
- all_legend_clients = []
267
- for e in exec_frames:
268
- c = e.get_legend_client()
269
- if c not in all_legend_clients:
270
- all_legend_clients.append(c)
271
- if len(all_legend_clients) > 1:
272
- raise ValueError(
273
- "Found tds frames with multiple legend_clients (which is not supported): [" +
274
- (", ".join([str(f) for f in all_legend_clients]) + "]")
275
- )
276
- legend_client = all_legend_clients[0]
277
- result = legend_client.execute_sql_string(self.to_sql_query(), chunk_size=chunk_size)
278
- return result_handler.handle_result(self, result)
279
-
280
- def execute_frame_to_string(
281
- self,
282
- chunk_size: PyLegendOptional[int] = None
283
- ) -> str:
284
- return self.execute_frame(ToStringResultHandler(), chunk_size)
285
-
286
- def execute_frame_to_pandas_df(
287
- self,
288
- chunk_size: PyLegendOptional[int] = None,
289
- pandas_df_read_config: PandasDfReadConfig = PandasDfReadConfig()
290
- ) -> pd.DataFrame:
291
- return self.execute_frame(
292
- ToPandasDfResultHandler(pandas_df_read_config),
293
- chunk_size
294
- )
@@ -1,115 +0,0 @@
1
- pylegend/__init__.py,sha256=ZoEkauXEzJAmNY-kUnpfkn8M21dZMh6ddYUP4LDyBms,1531
2
- pylegend/_typing.py,sha256=3P2K9xyyODrYRx3iDI8jtF1vGGqPbYiKqLEN9bBCdi0,1479
3
- pylegend/core/__init__.py,sha256=LXTDJSDmHQXtnMDZouhZp9IZQVpY6ONkINbUYjtnMkE,578
4
- pylegend/core/databse/__init__.py,sha256=LXTDJSDmHQXtnMDZouhZp9IZQVpY6ONkINbUYjtnMkE,578
5
- pylegend/core/databse/sql_to_string/__init__.py,sha256=LPvE3XwipxzoTLD5Iw0pQXHbqjQplAWo6nEPeFtBOfQ,1025
6
- pylegend/core/databse/sql_to_string/config.py,sha256=xrwPFcuZyzZcKNGeOQTnFW2y7CqhT6laSAazVl93JLU,1384
7
- pylegend/core/databse/sql_to_string/db_extension.py,sha256=KrliUcObJfKucHRxVNVV5FDGwZm9U7yH0T0TCQmIDy8,52468
8
- pylegend/core/databse/sql_to_string/generator.py,sha256=Tlz9ta3cY_LzZhe8XHn0afgsfV36Pd-bLyUng-oIprs,2605
9
- pylegend/core/language/__init__.py,sha256=DPhfz3HDui64H5ez954pMvjK66h2LUozPVTi2kePCtE,4182
10
- pylegend/core/language/aggregate_specification.py,sha256=3AJKZ9f2mi9n-nbHY8zo6T2ecKCixYzYUV82jyWVNG0,2119
11
- pylegend/core/language/column_expressions.py,sha256=YfLs-h0NVDKiKSdIhGe0dlDQ3u24KCJB38fviuI_di4,4335
12
- pylegend/core/language/expression.py,sha256=0fl0l1RnvkbyqfWbMAB_5VjL4Y21NeRkjq3eMCooFds,2225
13
- pylegend/core/language/functions.py,sha256=vp-JhTn6ITEKD1wpvcppzsYV_T3UVaIp0IzQYkhmgMM,1159
14
- pylegend/core/language/literal_expressions.py,sha256=W9pEoimuwxISP90yP7YSkxK00LI4UQNBQNKJCC70-Go,5056
15
- pylegend/core/language/operations/__init__.py,sha256=LXTDJSDmHQXtnMDZouhZp9IZQVpY6ONkINbUYjtnMkE,578
16
- pylegend/core/language/operations/binary_expression.py,sha256=N7zsk-3yl5fS5eyDT0_IeywFp2a1GFGCfbP0InrAprA,2226
17
- pylegend/core/language/operations/boolean_operation_expressions.py,sha256=Lmt9xpIlFvrI-wf4oYw4TSmofTU4itynWg8GPhydK5E,3468
18
- pylegend/core/language/operations/collection_operation_expressions.py,sha256=ThduIiwMNvr_IzoYlAUzVA-nfx44AmULA6-ToMy6cMM,17225
19
- pylegend/core/language/operations/date_operation_expressions.py,sha256=nwW-21LNV9lH4BleRcdCNnpg4p5qcK9XQkEbK4vOEkI,15827
20
- pylegend/core/language/operations/float_operation_expressions.py,sha256=VuMdstJs_zAjBMFsqg5IhKFCqdOwz_LD0_quOhZ9cq4,5029
21
- pylegend/core/language/operations/integer_operation_expressions.py,sha256=nckRjVvC5WjJngOcoah6KhrmO8I8rb_ZOM-gIvCQ_WM,5924
22
- pylegend/core/language/operations/nullary_expression.py,sha256=ujskdMci6d75Vq8OyEESssJ3eHvuzhqcK6tBn00Su2k,1730
23
- pylegend/core/language/operations/number_operation_expressions.py,sha256=4fsunzQwz9q0jknX7vfxs_kQy3t0E30LiF7yAlH0_II,21622
24
- pylegend/core/language/operations/primitive_operation_expressions.py,sha256=8YT7nJTKsCbEZuv4MipFyA1MF4OTwF5PaGsbG9J8f-s,1891
25
- pylegend/core/language/operations/string_operation_expressions.py,sha256=3W92fqDfKS1SP224EDlN04IUruOrdewvJVdIZobmKG4,12876
26
- pylegend/core/language/operations/unary_expression.py,sha256=Ly9Njo1yvSUc7GaGiOvc9JSiZegt94X10qoryWvcvfU,1968
27
- pylegend/core/language/primitive_collection.py,sha256=09B3wnCMto2YOWcmbSEqEA6XG2oU5BQ_ubSRTTI3VuU,13084
28
- pylegend/core/language/primitives/__init__.py,sha256=ZgW0B5Nh7wYUR3WWBUWBTjanOQuqARvETBeRYQKqCdQ,1586
29
- pylegend/core/language/primitives/boolean.py,sha256=3zCPIq-U58pu1nj5A0lyO8jenqwabSki7VNrWcezBic,3855
30
- pylegend/core/language/primitives/date.py,sha256=PUCjLB8En_TjdsSs8o7rd1IknAtnclzlzx5hBH9CosY,6661
31
- pylegend/core/language/primitives/datetime.py,sha256=Frnrk_JCQZlcG0bnYebZ7X8FKjNIHrWVsRuNPk33fSM,2484
32
- pylegend/core/language/primitives/float.py,sha256=np9JTeKaB588YhYMUkPaFoHInMguGIiH2yycD2tvQo0,6120
33
- pylegend/core/language/primitives/integer.py,sha256=5k6AR7fGt_mTuJ3ddU5WfsaYbDadVLPKlWjsshga0LA,7306
34
- pylegend/core/language/primitives/number.py,sha256=mIQCeQk8IWJFHcplUoF8xFI8SXEuV9ck7R0knJLVqmE,13452
35
- pylegend/core/language/primitives/primitive.py,sha256=YTN56bdI9uyz5WBAO4oCfZM-9uBbUKWlq-9ARY4Bw10,2974
36
- pylegend/core/language/primitives/strictdate.py,sha256=QUbUMMIViSC0HMBPUDXfFqbYiv4eE4r67fjFMsJTiFY,2490
37
- pylegend/core/language/primitives/string.py,sha256=riI340Iytk7zfThbPIfnJ3dyGnOZycfHM05jtKIgewQ,8341
38
- pylegend/core/language/tds_row.py,sha256=lrf129CatediTnbEh_d_IAIWjddoywxer_1L6fsBtUY,8175
39
- pylegend/core/project_cooridnates.py,sha256=t1G6gJzcRQRbCjGpCOk0vBiqd0F8Y_e15Nu4NuzYd6I,3751
40
- pylegend/core/request/__init__.py,sha256=WJ0lbiD9GRAGWDjvKqEFUoDbfg5-uEEGs0EE11dz1w0,1019
41
- pylegend/core/request/auth.py,sha256=eiv852B6Oe_iuonprdgwcMcARVPNhdtjhE-K0dRLgiw,2596
42
- pylegend/core/request/legend_client.py,sha256=upAAQt9Zhtf_oczlfV-LoWR7cm7y5bsGVf2p2aU7s_E,2773
43
- pylegend/core/request/response_reader.py,sha256=TNMi2GKk4lkmf7VMeY5n2AwhxxuWbX4M8pgC2_pXFbE,1691
44
- pylegend/core/request/service_client.py,sha256=oNvMR6qNl5UcxpcAjIb4CCpd0MB3Z-Y5OJSyFPGeerM,3377
45
- pylegend/core/sql/__init__.py,sha256=LXTDJSDmHQXtnMDZouhZp9IZQVpY6ONkINbUYjtnMkE,578
46
- pylegend/core/sql/metamodel.py,sha256=B7aqblDyyiTsqWZUW2Is9_2FHTsYTkvhJ1FVxXxoSF8,20134
47
- pylegend/core/sql/metamodel_extension.py,sha256=A3B1anMf1x54sjBIjZJhQWXX5IKIsQXFYaL5vWJC4ow,15348
48
- pylegend/core/tds/__init__.py,sha256=LXTDJSDmHQXtnMDZouhZp9IZQVpY6ONkINbUYjtnMkE,578
49
- pylegend/core/tds/legend_api/__init__.py,sha256=LXTDJSDmHQXtnMDZouhZp9IZQVpY6ONkINbUYjtnMkE,578
50
- pylegend/core/tds/legend_api/frames/__init__.py,sha256=LXTDJSDmHQXtnMDZouhZp9IZQVpY6ONkINbUYjtnMkE,578
51
- pylegend/core/tds/legend_api/frames/functions/__init__.py,sha256=LXTDJSDmHQXtnMDZouhZp9IZQVpY6ONkINbUYjtnMkE,578
52
- pylegend/core/tds/legend_api/frames/functions/concatenate_function.py,sha256=HvZzzr6WG3Mrh5f_vOS3KdVTyx6fDSRmduI6I7HT1TY,4750
53
- pylegend/core/tds/legend_api/frames/functions/distinct_function.py,sha256=SxitH4jsMATounpnJZ_1Z40NxNxR5kLX-5G_7UoiWz8,2266
54
- pylegend/core/tds/legend_api/frames/functions/drop_function.py,sha256=behNpSqUZyXUYY--EJBZyq2pxtN_YXusn2Zc6PP_yHQ,2487
55
- pylegend/core/tds/legend_api/frames/functions/extend_function.py,sha256=t4Qf3YGPOmZvZ7e-O6Dgz_DcXYGjOuF6JK_H8Bl-0uc,6198
56
- pylegend/core/tds/legend_api/frames/functions/filter_function.py,sha256=h9fqfZxTFpg_SdbzlehqkGgArR0gbxAYp7yykdXEyvI,4063
57
- pylegend/core/tds/legend_api/frames/functions/function_helpers.py,sha256=rK3WjL2hPez6pqRdajBI8hxe_DEhUaLkReSAnzkftSY,2046
58
- pylegend/core/tds/legend_api/frames/functions/group_by_function.py,sha256=RVCw1Tbv9Q9wmBiaWXHBcYI7DJqHehrkrutbxOMgPCw,9041
59
- pylegend/core/tds/legend_api/frames/functions/head_function.py,sha256=esBhaouhymgo1Dy0atqgyg6jl0kPDdbGNujoRn54bm4,2463
60
- pylegend/core/tds/legend_api/frames/functions/join_by_columns_function.py,sha256=8PSI2lBfAqCJ-bDtQK98Vowqd-NhewGLfdyEG1YxnNw,9924
61
- pylegend/core/tds/legend_api/frames/functions/join_function.py,sha256=8b3rGlXSr1nbWl5qH7L3S10sSxuc5FbVRLz5dOcXY1g,7667
62
- pylegend/core/tds/legend_api/frames/functions/rename_columns_function.py,sha256=g_k8ALXUfuyLYjrMeY059P2Dml4PFpyX4_J3vvp3Yy8,5071
63
- pylegend/core/tds/legend_api/frames/functions/restrict_function.py,sha256=v9uoF3nBU6RnwWD1OUAf0t1jp80pGZrNpYf0sohe9B8,4427
64
- pylegend/core/tds/legend_api/frames/functions/slice_function.py,sha256=VQsQK0S2KqlwFHhEcq6i06sF4hJl3fwHCNIbdeoUnwU,2947
65
- pylegend/core/tds/legend_api/frames/functions/sort_function.py,sha256=R5XLOzAOdoh-0M6137sL-_OrydOND3cRIco6LeI1aMc,5246
66
- pylegend/core/tds/legend_api/frames/legend_api_applied_function_tds_frame.py,sha256=ttIZMyjW__Yf8AqfaK4jY2eiUgN9IH20S9aPSRDSeGo,2539
67
- pylegend/core/tds/legend_api/frames/legend_api_base_tds_frame.py,sha256=SrYbjd3yPB89Q2w-bSpxCnuUzwVYy7TQyXZC90yBW4I,11839
68
- pylegend/core/tds/legend_api/frames/legend_api_input_tds_frame.py,sha256=lD1PtTaduiQxot7kT54Vl62EDbbHIjoi2qtEw20AVvs,1912
69
- pylegend/core/tds/legend_api/frames/legend_api_tds_frame.py,sha256=tCUwjpCDhFgxDfPWGLN3a31PCzBVROolOUe1LuRZq4U,4115
70
- pylegend/core/tds/pandas_api/__init__.py,sha256=LXTDJSDmHQXtnMDZouhZp9IZQVpY6ONkINbUYjtnMkE,578
71
- pylegend/core/tds/pandas_api/frames/__init__.py,sha256=LXTDJSDmHQXtnMDZouhZp9IZQVpY6ONkINbUYjtnMkE,578
72
- pylegend/core/tds/pandas_api/frames/functions/__init__.py,sha256=LXTDJSDmHQXtnMDZouhZp9IZQVpY6ONkINbUYjtnMkE,578
73
- pylegend/core/tds/pandas_api/frames/functions/assign_function.py,sha256=MpilLFy_IcPH_Gbze7eE5k-8VVqWrdwJOG0_xcOZKFI,4579
74
- pylegend/core/tds/pandas_api/frames/pandas_api_applied_function_tds_frame.py,sha256=HL54C8lUguGCyJuSAxIecIeKxm21deOPI2lO2EXiF8Y,2539
75
- pylegend/core/tds/pandas_api/frames/pandas_api_base_tds_frame.py,sha256=6dtTpWFG4k6yjCMwsVZHp03apDpXOsKGWT9ggz1paQQ,5446
76
- pylegend/core/tds/pandas_api/frames/pandas_api_input_tds_frame.py,sha256=R74vHUXs7G1V_fquGS9-Y9OfagL4kY2zfd1PNNme4S4,1913
77
- pylegend/core/tds/pandas_api/frames/pandas_api_tds_frame.py,sha256=aWJm1V11UuChWCCTM2bJy6GTnPL5b_dB9_p0sUEuD7s,1267
78
- pylegend/core/tds/result_handler/__init__.py,sha256=8RE84xfkARwDbaQCvZulXcvDJlI-V5DuJp9RsdaGnqU,1141
79
- pylegend/core/tds/result_handler/result_handler.py,sha256=7tSzOswFCapAAdACphIR3Q0QISYyjo_On_vtsUIPAbA,1183
80
- pylegend/core/tds/result_handler/to_csv_file_result_handler.py,sha256=lm0UG87RNUXqQwOtSgxHbLKzAHebNuE3zIXM3ErtOxM,2270
81
- pylegend/core/tds/result_handler/to_json_file_result_handler.py,sha256=6Qc6hxNvWhceMeIE8skdwcY5V_dLJ7YHmxV37W6MRdo,1357
82
- pylegend/core/tds/result_handler/to_string_result_handler.py,sha256=y7xlSahtrsMhzFU2aPHgoT2NKm-Jn7RC2rEZmbYfYTY,1142
83
- pylegend/core/tds/sql_query_helpers.py,sha256=9uN6I8D-fLdqVbkJb5gWm0wU-QrKDdtH4pdM_Njn55c,3614
84
- pylegend/core/tds/tds_column.py,sha256=Kyi39cO0X9lFOom1m0gC4GrWBSmzlMj4BMT-9x_cG3A,5231
85
- pylegend/core/tds/tds_frame.py,sha256=xQHjlFF7OQvENDCfhg3wwcgHrWFCFyuZWbMJcFtFeH0,2745
86
- pylegend/extensions/__init__.py,sha256=LXTDJSDmHQXtnMDZouhZp9IZQVpY6ONkINbUYjtnMkE,578
87
- pylegend/extensions/database/__init__.py,sha256=LXTDJSDmHQXtnMDZouhZp9IZQVpY6ONkINbUYjtnMkE,578
88
- pylegend/extensions/database/vendors/__init__.py,sha256=LXTDJSDmHQXtnMDZouhZp9IZQVpY6ONkINbUYjtnMkE,578
89
- pylegend/extensions/database/vendors/postgres/__init__.py,sha256=LXTDJSDmHQXtnMDZouhZp9IZQVpY6ONkINbUYjtnMkE,578
90
- pylegend/extensions/database/vendors/postgres/postgres_sql_to_string.py,sha256=u4ct89lOjpi5yP7A_-HpvfuJ6C7k62Q0WnfOhhYm8yg,1340
91
- pylegend/extensions/tds/__init__.py,sha256=LXTDJSDmHQXtnMDZouhZp9IZQVpY6ONkINbUYjtnMkE,578
92
- pylegend/extensions/tds/abstract/__init__.py,sha256=LXTDJSDmHQXtnMDZouhZp9IZQVpY6ONkINbUYjtnMkE,578
93
- pylegend/extensions/tds/abstract/legend_function_input_frame.py,sha256=5oj5q-tVqsT86tBYDFdr3KV4P0f8eOuv_BbJpyc4LAI,3428
94
- pylegend/extensions/tds/abstract/legend_service_input_frame.py,sha256=ho-jiUYpYJazVtWxc7Cdtk3B7A5-LI5b-PYu0osS4go,3453
95
- pylegend/extensions/tds/abstract/table_spec_input_frame.py,sha256=MMaMdk_XVVW4jwKLnkHET7s6HkZl_WfLlFZUHLvt5Gc,2326
96
- pylegend/extensions/tds/legend_api/__init__.py,sha256=LXTDJSDmHQXtnMDZouhZp9IZQVpY6ONkINbUYjtnMkE,578
97
- pylegend/extensions/tds/legend_api/frames/__init__.py,sha256=LXTDJSDmHQXtnMDZouhZp9IZQVpY6ONkINbUYjtnMkE,578
98
- pylegend/extensions/tds/legend_api/frames/legend_api_legend_function_input_frame.py,sha256=0pQHk9SsJcND8oCWwhjBEHPxh6ddjwak8MLEmVKoFnw,1818
99
- pylegend/extensions/tds/legend_api/frames/legend_api_legend_service_input_frame.py,sha256=1-vR9sES55ZGkylGHlNTPrkq1aWRnsZrt3kCvXFftTo,1823
100
- pylegend/extensions/tds/legend_api/frames/legend_api_table_spec_input_frame.py,sha256=fdcs00l2LKcEhrsnpjIfKzHPenucVeALGkSniVxdx_Q,1465
101
- pylegend/extensions/tds/pandas_api/__init__.py,sha256=LXTDJSDmHQXtnMDZouhZp9IZQVpY6ONkINbUYjtnMkE,578
102
- pylegend/extensions/tds/pandas_api/frames/__init__.py,sha256=LXTDJSDmHQXtnMDZouhZp9IZQVpY6ONkINbUYjtnMkE,578
103
- pylegend/extensions/tds/pandas_api/frames/pandas_api_legend_function_input_frame.py,sha256=aJaNPJcfMdc8HTJKErah4BYSnHfmKMIMvoKtEeCx4zQ,1818
104
- pylegend/extensions/tds/pandas_api/frames/pandas_api_legend_service_input_frame.py,sha256=dOV6qXIrNkZ8gwmPt0ljr5CVViS4AH5Y4h3L-1WnNdM,1822
105
- pylegend/extensions/tds/pandas_api/frames/pandas_api_table_spec_input_frame.py,sha256=2pj-siOOvIFEqNOG-f4VUvhY9gBGUFFDZz7jZl7QpLg,1465
106
- pylegend/extensions/tds/result_handler/__init__.py,sha256=NIIUcl39wpSc51IhUUEKtEYlve89Xncq0YEG78Gren4,864
107
- pylegend/extensions/tds/result_handler/to_pandas_df_result_handler.py,sha256=tvVsxDOzHNTvzjdApIhmeefws5_u0N8Rqm7UvEtj70w,4958
108
- pylegend/legend_api_tds_client.py,sha256=I0uRF7ADGvV5fHN-dEBIrdxTy7GC8jV91V62rgXn6c0,2319
109
- pylegend/utils/__init__.py,sha256=LXTDJSDmHQXtnMDZouhZp9IZQVpY6ONkINbUYjtnMkE,578
110
- pylegend/utils/class_utils.py,sha256=t4PpF3jAXS_D6p9TqlSppryNYNOuy5C-kbKn2Kgb4QU,973
111
- pylegend-0.3.0.dist-info/LICENSE,sha256=AGR96_qQPZO66Gjqq4G6r_g670K35VtW-IobTAkmZJM,11343
112
- pylegend-0.3.0.dist-info/LICENSE.spdx,sha256=i7TsBclLotUvMjx9vZ_6S8Pp0r4uknWGw1RwiKBBvQ4,207
113
- pylegend-0.3.0.dist-info/METADATA,sha256=rPPekqxiSfyqB7by4D3lv_mgo8CKmgk7_EZAvkhMTmc,4267
114
- pylegend-0.3.0.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
115
- pylegend-0.3.0.dist-info/RECORD,,
File without changes