another-ayx-python-sdk 2.4.24__py3-none-any.whl → 2.4.25__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 (212) hide show
  1. another_ayx_python_sdk/version.py +3 -3
  2. {another_ayx_python_sdk-2.4.24.dist-info → another_ayx_python_sdk-2.4.25.dist-info}/METADATA +1 -1
  3. {another_ayx_python_sdk-2.4.24.dist-info → another_ayx_python_sdk-2.4.25.dist-info}/RECORD +7 -212
  4. {another_ayx_python_sdk-2.4.24.dist-info → another_ayx_python_sdk-2.4.25.dist-info}/top_level.txt +0 -2
  5. build/lib/another_ayx_python_sdk/__init__.py +0 -14
  6. build/lib/another_ayx_python_sdk/__main__.py +0 -470
  7. build/lib/another_ayx_python_sdk/assets/workspace_files/__init__.py +0 -14
  8. build/lib/another_ayx_python_sdk/assets/workspace_files/setup.py +0 -38
  9. build/lib/another_ayx_python_sdk/cli/__init__.py +0 -14
  10. build/lib/another_ayx_python_sdk/cli/utilities.py +0 -103
  11. build/lib/another_ayx_python_sdk/cli/workspace.py +0 -266
  12. build/lib/another_ayx_python_sdk/cli/yxi_builder.py +0 -125
  13. build/lib/another_ayx_python_sdk/cli/yxi_installer.py +0 -45
  14. build/lib/another_ayx_python_sdk/core/__init__.py +0 -51
  15. build/lib/another_ayx_python_sdk/core/constants.py +0 -25
  16. build/lib/another_ayx_python_sdk/core/dcm_base.py +0 -115
  17. build/lib/another_ayx_python_sdk/core/doc_utilities.py +0 -40
  18. build/lib/another_ayx_python_sdk/core/environment_base.py +0 -213
  19. build/lib/another_ayx_python_sdk/core/exceptions.py +0 -59
  20. build/lib/another_ayx_python_sdk/core/field.py +0 -183
  21. build/lib/another_ayx_python_sdk/core/input_anchor_base.py +0 -86
  22. build/lib/another_ayx_python_sdk/core/input_connection_base.py +0 -206
  23. build/lib/another_ayx_python_sdk/core/io_base.py +0 -139
  24. build/lib/another_ayx_python_sdk/core/metadata.py +0 -173
  25. build/lib/another_ayx_python_sdk/core/observable_mixin.py +0 -90
  26. build/lib/another_ayx_python_sdk/core/output_anchor_base.py +0 -151
  27. build/lib/another_ayx_python_sdk/core/plugin.py +0 -108
  28. build/lib/another_ayx_python_sdk/core/plugin_v2.py +0 -97
  29. build/lib/another_ayx_python_sdk/core/provider_base.py +0 -125
  30. build/lib/another_ayx_python_sdk/core/proxy_requests.py +0 -51
  31. build/lib/another_ayx_python_sdk/core/record_packet.py +0 -88
  32. build/lib/another_ayx_python_sdk/core/record_packet_base.py +0 -123
  33. build/lib/another_ayx_python_sdk/core/register_plugin.py +0 -127
  34. build/lib/another_ayx_python_sdk/core/testing.py +0 -191
  35. build/lib/another_ayx_python_sdk/core/utils.py +0 -146
  36. build/lib/another_ayx_python_sdk/examples/AyxSdkInput/main.py +0 -89
  37. build/lib/another_ayx_python_sdk/examples/AyxSdkMultiConnectionsMultiOutputAnchor/main.py +0 -102
  38. build/lib/another_ayx_python_sdk/examples/AyxSdkMultipleInputAnchors/main.py +0 -84
  39. build/lib/another_ayx_python_sdk/examples/AyxSdkMultipleOutputAnchors/main.py +0 -96
  40. build/lib/another_ayx_python_sdk/examples/AyxSdkOptionalInputAnchor/main.py +0 -94
  41. build/lib/another_ayx_python_sdk/examples/AyxSdkOutput/main.py +0 -78
  42. build/lib/another_ayx_python_sdk/examples/AyxSdkPassThrough/main.py +0 -82
  43. build/lib/another_ayx_python_sdk/providers/__init__.py +0 -14
  44. build/lib/another_ayx_python_sdk/providers/amp_provider/__init__.py +0 -41
  45. build/lib/another_ayx_python_sdk/providers/amp_provider/__main__.py +0 -85
  46. build/lib/another_ayx_python_sdk/providers/amp_provider/amp_dcm.py +0 -58
  47. build/lib/another_ayx_python_sdk/providers/amp_provider/amp_driver.py +0 -358
  48. build/lib/another_ayx_python_sdk/providers/amp_provider/amp_environment.py +0 -73
  49. build/lib/another_ayx_python_sdk/providers/amp_provider/amp_environment_v2.py +0 -278
  50. build/lib/another_ayx_python_sdk/providers/amp_provider/amp_input_anchor.py +0 -73
  51. build/lib/another_ayx_python_sdk/providers/amp_provider/amp_input_connection.py +0 -132
  52. build/lib/another_ayx_python_sdk/providers/amp_provider/amp_io.py +0 -64
  53. build/lib/another_ayx_python_sdk/providers/amp_provider/amp_io_components.py +0 -407
  54. build/lib/another_ayx_python_sdk/providers/amp_provider/amp_output_anchor.py +0 -107
  55. build/lib/another_ayx_python_sdk/providers/amp_provider/amp_provider.py +0 -68
  56. build/lib/another_ayx_python_sdk/providers/amp_provider/amp_provider_v2.py +0 -128
  57. build/lib/another_ayx_python_sdk/providers/amp_provider/amp_record_packet.py +0 -21
  58. build/lib/another_ayx_python_sdk/providers/amp_provider/builders/__init__.py +0 -32
  59. build/lib/another_ayx_python_sdk/providers/amp_provider/builders/input_anchor_builder.py +0 -123
  60. build/lib/another_ayx_python_sdk/providers/amp_provider/builders/input_connection_builder.py +0 -95
  61. build/lib/another_ayx_python_sdk/providers/amp_provider/builders/metadata_builder.py +0 -118
  62. build/lib/another_ayx_python_sdk/providers/amp_provider/builders/output_anchor_builder.py +0 -110
  63. build/lib/another_ayx_python_sdk/providers/amp_provider/builders/packers.py +0 -458
  64. build/lib/another_ayx_python_sdk/providers/amp_provider/builders/record_builder.py +0 -204
  65. build/lib/another_ayx_python_sdk/providers/amp_provider/builders/record_packet_builder.py +0 -133
  66. build/lib/another_ayx_python_sdk/providers/amp_provider/builders/tool_config_builder.py +0 -59
  67. build/lib/another_ayx_python_sdk/providers/amp_provider/cng_certs.py +0 -197
  68. build/lib/another_ayx_python_sdk/providers/amp_provider/data_transport/__init__.py +0 -18
  69. build/lib/another_ayx_python_sdk/providers/amp_provider/data_transport/amp_transport.py +0 -127
  70. build/lib/another_ayx_python_sdk/providers/amp_provider/data_transport/transport_base.py +0 -35
  71. build/lib/another_ayx_python_sdk/providers/amp_provider/grpc_helpers/__init__.py +0 -14
  72. build/lib/another_ayx_python_sdk/providers/amp_provider/grpc_helpers/control_msgs.py +0 -189
  73. build/lib/another_ayx_python_sdk/providers/amp_provider/grpc_helpers/dcme_msgs.py +0 -119
  74. build/lib/another_ayx_python_sdk/providers/amp_provider/grpc_helpers/record_transfer_msgs.py +0 -32
  75. build/lib/another_ayx_python_sdk/providers/amp_provider/grpc_util.py +0 -161
  76. build/lib/another_ayx_python_sdk/providers/amp_provider/logger_config.py +0 -63
  77. build/lib/another_ayx_python_sdk/providers/amp_provider/plugin_class_loader.py +0 -77
  78. build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/__init__.py +0 -67
  79. build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/dcm_repository.py +0 -252
  80. build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/environment_repository.py +0 -212
  81. build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/grpc_repository.py +0 -119
  82. build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/input_anchor_repository.py +0 -110
  83. build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/input_connection_repository.py +0 -276
  84. build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/input_metadata_repository.py +0 -144
  85. build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/input_record_packet_repository.py +0 -252
  86. build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/io_repository.py +0 -188
  87. build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/output_anchor_repository.py +0 -117
  88. build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/output_metadata_repository.py +0 -129
  89. build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/output_record_packet_repository.py +0 -170
  90. build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/plugin_class_repository.py +0 -55
  91. build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/singleton.py +0 -32
  92. build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/test_harness_state_repository.py +0 -172
  93. build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/tool_config_repository.py +0 -89
  94. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/__init__.py +0 -14
  95. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/__init__.py +0 -0
  96. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/close_outgoing_anchor_pb2.py +0 -25
  97. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/close_outgoing_anchor_pb2_grpc.py +0 -4
  98. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/dcm_e_pb2.py +0 -38
  99. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/dcm_e_pb2_grpc.py +0 -4
  100. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/incoming_anchor_pb2.py +0 -26
  101. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/incoming_anchor_pb2_grpc.py +0 -4
  102. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/incoming_connection_complete_pb2.py +0 -25
  103. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/incoming_connection_complete_pb2_grpc.py +0 -4
  104. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/incoming_connection_pb2.py +0 -26
  105. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/incoming_connection_pb2_grpc.py +0 -4
  106. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/incoming_data_push_pb2.py +0 -26
  107. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/incoming_data_push_pb2_grpc.py +0 -4
  108. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/incoming_record_packet_push_pb2.py +0 -26
  109. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/incoming_record_packet_push_pb2_grpc.py +0 -4
  110. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/metadata_pb2.py +0 -31
  111. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/metadata_pb2_grpc.py +0 -4
  112. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/outgoing_anchor_pb2.py +0 -28
  113. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/outgoing_anchor_pb2_grpc.py +0 -4
  114. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/outgoing_data_push_pb2.py +0 -26
  115. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/outgoing_data_push_pb2_grpc.py +0 -4
  116. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/outgoing_metadata_push_pb2.py +0 -26
  117. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/outgoing_metadata_push_pb2_grpc.py +0 -4
  118. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/outgoing_record_packet_push_pb2.py +0 -26
  119. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/outgoing_record_packet_push_pb2_grpc.py +0 -4
  120. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/output_message_data_pb2.py +0 -29
  121. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/output_message_data_pb2_grpc.py +0 -4
  122. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/password_data_pb2.py +0 -25
  123. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/password_data_pb2_grpc.py +0 -4
  124. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/plugin_initialization_data_pb2.py +0 -33
  125. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/plugin_initialization_data_pb2_grpc.py +0 -4
  126. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/record_batch_pb2.py +0 -25
  127. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/record_batch_pb2_grpc.py +0 -4
  128. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/record_packet_pb2.py +0 -29
  129. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/record_packet_pb2_grpc.py +0 -4
  130. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/sdk_engine_service_pb2.py +0 -34
  131. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/sdk_engine_service_pb2_grpc.py +0 -305
  132. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/sdk_tool_service_pb2.py +0 -30
  133. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/sdk_tool_service_pb2_grpc.py +0 -235
  134. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/sdk_tool_service_startup_info_pb2.py +0 -25
  135. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/sdk_tool_service_startup_info_pb2_grpc.py +0 -4
  136. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/sdk_tool_service_v2_pb2.py +0 -54
  137. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/sdk_tool_service_v2_pb2_grpc.py +0 -99
  138. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/translate_message_data_pb2.py +0 -27
  139. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/translate_message_data_pb2_grpc.py +0 -4
  140. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/transport_pb2.py +0 -31
  141. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/transport_pb2_grpc.py +0 -4
  142. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/update_progress_pb2.py +0 -25
  143. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/update_progress_pb2_grpc.py +0 -4
  144. build/lib/another_ayx_python_sdk/providers/amp_provider/sdk_tool_runner.py +0 -115
  145. build/lib/another_ayx_python_sdk/providers/amp_provider/sdk_tool_service.py +0 -207
  146. build/lib/another_ayx_python_sdk/providers/amp_provider/sdk_tool_service_v2.py +0 -306
  147. build/lib/another_ayx_python_sdk/providers/amp_provider/utilities/__init__.py +0 -14
  148. build/lib/another_ayx_python_sdk/providers/amp_provider/utilities/constants.py +0 -22
  149. build/lib/another_ayx_python_sdk/providers/amp_provider/utilities/conversions.py +0 -55
  150. build/lib/another_ayx_python_sdk/providers/amp_provider/utilities/utilities.py +0 -63
  151. build/lib/another_ayx_python_sdk/providers/e1_provider/__init__.py +0 -36
  152. build/lib/another_ayx_python_sdk/providers/e1_provider/anchor_builder.py +0 -95
  153. build/lib/another_ayx_python_sdk/providers/e1_provider/cache_e1_sdk_import.py +0 -31
  154. build/lib/another_ayx_python_sdk/providers/e1_provider/connection_callback_strategy.py +0 -155
  155. build/lib/another_ayx_python_sdk/providers/e1_provider/connection_interface.py +0 -125
  156. build/lib/another_ayx_python_sdk/providers/e1_provider/e1_dcm.py +0 -53
  157. build/lib/another_ayx_python_sdk/providers/e1_provider/e1_environment.py +0 -127
  158. build/lib/another_ayx_python_sdk/providers/e1_provider/e1_input_anchor.py +0 -51
  159. build/lib/another_ayx_python_sdk/providers/e1_provider/e1_input_anchor_proxy.py +0 -33
  160. build/lib/another_ayx_python_sdk/providers/e1_provider/e1_input_connection.py +0 -87
  161. build/lib/another_ayx_python_sdk/providers/e1_provider/e1_io.py +0 -71
  162. build/lib/another_ayx_python_sdk/providers/e1_provider/e1_output_anchor.py +0 -157
  163. build/lib/another_ayx_python_sdk/providers/e1_provider/e1_output_anchor_proxy.py +0 -97
  164. build/lib/another_ayx_python_sdk/providers/e1_provider/e1_plugin_driver.py +0 -63
  165. build/lib/another_ayx_python_sdk/providers/e1_provider/e1_plugin_proxy.py +0 -363
  166. build/lib/another_ayx_python_sdk/providers/e1_provider/e1_provider.py +0 -71
  167. build/lib/another_ayx_python_sdk/providers/e1_provider/e1_record_packet.py +0 -21
  168. build/lib/another_ayx_python_sdk/providers/e1_provider/events.py +0 -36
  169. build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/AlteryxPythonSDK/__init__.py +0 -37
  170. build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/AlteryxPythonSDK/alteryx_engine.py +0 -105
  171. build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/AlteryxPythonSDK/constants.py +0 -50
  172. build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/AlteryxPythonSDK/field.py +0 -122
  173. build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/AlteryxPythonSDK/output_anchor.py +0 -55
  174. build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/AlteryxPythonSDK/output_anchor_manager.py +0 -31
  175. build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/AlteryxPythonSDK/record_copier.py +0 -65
  176. build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/AlteryxPythonSDK/record_creator.py +0 -41
  177. build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/AlteryxPythonSDK/record_info.py +0 -134
  178. build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/AlteryxPythonSDK/record_ref.py +0 -42
  179. build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/AlteryxPythonSDK/tool.py +0 -29
  180. build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/AlteryxPythonSDK/tool_execution_info.py +0 -43
  181. build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/__init__.py +0 -14
  182. build/lib/another_ayx_python_sdk/providers/e1_provider/proxies/__init__.py +0 -18
  183. build/lib/another_ayx_python_sdk/providers/e1_provider/proxies/field_proxy.py +0 -109
  184. build/lib/another_ayx_python_sdk/providers/e1_provider/proxies/record_copier_proxy.py +0 -49
  185. build/lib/another_ayx_python_sdk/providers/e1_provider/records/__init__.py +0 -23
  186. build/lib/another_ayx_python_sdk/providers/e1_provider/records/base_record_container.py +0 -47
  187. build/lib/another_ayx_python_sdk/providers/e1_provider/records/parsed_record_container.py +0 -67
  188. build/lib/another_ayx_python_sdk/providers/e1_provider/records/raw_record_container.py +0 -111
  189. build/lib/another_ayx_python_sdk/providers/e1_provider/tool_config_loader.py +0 -132
  190. build/lib/another_ayx_python_sdk/providers/e1_provider/utilities/__init__.py +0 -35
  191. build/lib/another_ayx_python_sdk/providers/e1_provider/utilities/utilities.py +0 -54
  192. build/lib/another_ayx_python_sdk/providers/e1_provider/workflow_config.py +0 -31
  193. build/lib/another_ayx_python_sdk/providers/file_provider/__init__.py +0 -32
  194. build/lib/another_ayx_python_sdk/providers/file_provider/environment.py +0 -131
  195. build/lib/another_ayx_python_sdk/providers/file_provider/file_adapter.py +0 -286
  196. build/lib/another_ayx_python_sdk/providers/file_provider/file_provider.py +0 -185
  197. build/lib/another_ayx_python_sdk/providers/file_provider/file_provider_dcm.py +0 -53
  198. build/lib/another_ayx_python_sdk/providers/file_provider/file_provider_input_anchor.py +0 -70
  199. build/lib/another_ayx_python_sdk/providers/file_provider/file_provider_input_connection.py +0 -112
  200. build/lib/another_ayx_python_sdk/providers/file_provider/file_provider_output_anchor.py +0 -114
  201. build/lib/another_ayx_python_sdk/providers/file_provider/file_record_packet.py +0 -21
  202. build/lib/another_ayx_python_sdk/providers/file_provider/iox.py +0 -56
  203. build/lib/another_ayx_python_sdk/providers/file_provider/tool_input.py +0 -104
  204. build/lib/another_ayx_python_sdk/test_harness/__init__.py +0 -14
  205. build/lib/another_ayx_python_sdk/test_harness/__main__.py +0 -120
  206. build/lib/another_ayx_python_sdk/test_harness/plugin_runner.py +0 -416
  207. build/lib/another_ayx_python_sdk/test_harness/process_lifecycle_manager.py +0 -80
  208. build/lib/another_ayx_python_sdk/test_harness/sdk_engine_service.py +0 -106
  209. build/lib/another_ayx_python_sdk/version.py +0 -8
  210. {another_ayx_python_sdk-2.4.24.dist-info → another_ayx_python_sdk-2.4.25.dist-info}/WHEEL +0 -0
  211. {another_ayx_python_sdk-2.4.24.dist-info → another_ayx_python_sdk-2.4.25.dist-info}/entry_points.txt +0 -0
  212. {another_ayx_python_sdk-2.4.24.dist-info → another_ayx_python_sdk-2.4.25.dist-info}/licenses/LICENSE +0 -0
@@ -1,458 +0,0 @@
1
- # Copyright (C) 2022 Alteryx, Inc. All rights reserved.
2
- #
3
- # Licensed under the ALTERYX SDK AND API LICENSE AGREEMENT;
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
- # https://www.alteryx.com/alteryx-sdk-and-api-license-agreement
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
- """Utility classes for converting between byte representations."""
15
- import datetime
16
- import struct
17
- from abc import ABC, abstractmethod
18
- from decimal import Decimal
19
- from functools import lru_cache
20
- from typing import Any, Callable, Tuple
21
-
22
-
23
- class _Packer(ABC):
24
- def pack(self, element: Any) -> bytes:
25
- try:
26
- element = self._caster(element)
27
- except Exception:
28
- raise ValueError(
29
- f"Could not cast value {element} with caster {self._caster}."
30
- )
31
-
32
- self._validator(element)
33
- return struct.pack(self._format_code, self._caster(element))
34
-
35
- def unpack(self, raw_bytes: bytes, start_idx: int) -> Tuple[Any, int]:
36
- element_bytes = raw_bytes[start_idx : start_idx + self._element_size]
37
- [parsed_element] = struct.unpack(self._format_code, element_bytes)
38
-
39
- self._validator(parsed_element)
40
- return self._caster(parsed_element), self._element_size
41
-
42
- @property
43
- @abstractmethod
44
- def _format_code(self) -> str:
45
- """Get the format code for struct package."""
46
- raise NotImplementedError()
47
-
48
- @property
49
- @abstractmethod
50
- def _element_size(self) -> int:
51
- """Get the element size (in bytes) of the packer."""
52
- raise NotImplementedError()
53
-
54
- @property
55
- @abstractmethod
56
- def _caster(self) -> Callable:
57
- """Get the method for casting the element."""
58
- raise NotImplementedError()
59
-
60
- @staticmethod
61
- def _unpack_sized_blob(blob: bytes, start_idx: int) -> Tuple[bytes, int]:
62
- element_size, integer_size = _UnsignedIntegerPacker().unpack(blob, start_idx)
63
- return (
64
- blob[start_idx + integer_size : start_idx + integer_size + element_size],
65
- element_size + integer_size,
66
- )
67
-
68
- @abstractmethod
69
- def _validator(self, element: Any) -> None:
70
- """Validate the data."""
71
- raise NotImplementedError()
72
-
73
-
74
- class _BoolPacker(_Packer):
75
- _element_size = 1
76
- _format_code = "?"
77
- _caster = bool
78
-
79
- def _validator(self, element: Any) -> None:
80
- # No additional validation needed for booleans
81
- pass
82
-
83
-
84
- class _IntegerPacker(_Packer):
85
- _element_size = 4
86
- _format_code = "i"
87
- _caster = int
88
- _signed = True
89
-
90
- def _validator(self, element: Any) -> None:
91
- """Validate the data."""
92
- _validate_integer(element, self._element_size * 8, self._signed)
93
-
94
-
95
- class _BytePacker(_IntegerPacker):
96
- _element_size = 1
97
- _format_code = "B"
98
- _caster = int
99
- _signed = False
100
-
101
-
102
- class _Int16Packer(_IntegerPacker):
103
- _element_size = 2
104
- _format_code = "h"
105
- _caster = int
106
-
107
-
108
- class _UnsignedIntegerPacker(_IntegerPacker):
109
- _element_size = 4
110
- _format_code = "I"
111
- _caster = int
112
- _signed = False
113
-
114
-
115
- class _LongIntegerPacker(_IntegerPacker):
116
- _element_size = 8
117
- _format_code = "q"
118
- _caster = int
119
-
120
-
121
- class _FloatPacker(_Packer):
122
- _element_size = 4
123
- _format_code = "f"
124
- _caster = float
125
-
126
- def _validator(self, element: Any) -> None:
127
- _validate_float(element, 1e38, 3.4)
128
-
129
-
130
- class _DoublePacker(_Packer):
131
- _element_size = 8
132
- _format_code = "d"
133
- _caster = float
134
-
135
- def _validator(self, element: Any) -> None:
136
- _validate_float(element, 1e308, 1.7)
137
-
138
-
139
- class _StringPacker(_Packer):
140
- def pack(self, string: str) -> bytes:
141
- string = str(string)
142
- self._validator(string)
143
-
144
- string_bytes = string.encode("utf-8")
145
- string_size = len(string_bytes)
146
-
147
- return _UnsignedIntegerPacker().pack(string_size) + string_bytes
148
-
149
- def unpack(self, raw_bytes: bytes, start_idx: int) -> Tuple[str, int]:
150
- blob, element_size = self._unpack_sized_blob(raw_bytes, start_idx)
151
-
152
- string = blob.decode("utf-8")
153
- self._validator(string)
154
- return string, element_size
155
-
156
- @property
157
- def _format_code(self) -> str:
158
- """Get the format code for struct package."""
159
- raise NotImplementedError()
160
-
161
- @property
162
- def _element_size(self) -> int:
163
- """Get the element size (in bytes) of the packer."""
164
- raise NotImplementedError()
165
-
166
- @property
167
- def _caster(self) -> int:
168
- """Get the method for casting the element."""
169
- raise NotImplementedError()
170
-
171
- def _validator(self, element: Any) -> None:
172
- # No additional validation needed for strings
173
- pass
174
-
175
-
176
- class _DatePacker(_StringPacker):
177
- def _validator(self, element: Any) -> None:
178
- super()._validator(element)
179
- datetime.datetime.strptime(element, "%Y-%m-%d")
180
-
181
-
182
- class _DatetimePacker(_StringPacker):
183
- def _validator(self, element: Any) -> None:
184
- super()._validator(element)
185
- datetime.datetime.strptime(element, "%Y-%m-%d %H:%M:%S")
186
-
187
-
188
- class _BlobPacker(_Packer):
189
- def pack(self, blob: bytes) -> bytes:
190
- blob = bytes(blob)
191
- self._validator(blob)
192
- return _UnsignedIntegerPacker().pack(len(blob)) + blob
193
-
194
- def unpack(self, raw_bytes: bytes, start_idx: int) -> Tuple[bytes, int]:
195
- blob, size = self._unpack_sized_blob(raw_bytes, start_idx)
196
- self._validator(blob)
197
- return blob, size
198
-
199
- @property
200
- def _format_code(self) -> str:
201
- """Get the format code for struct package."""
202
- raise NotImplementedError()
203
-
204
- @property
205
- def _element_size(self) -> int:
206
- """Get the element size (in bytes) of the packer."""
207
- raise NotImplementedError()
208
-
209
- @property
210
- def _caster(self) -> int:
211
- """Get the method for casting the element."""
212
- raise NotImplementedError()
213
-
214
- def _validator(self, element: Any) -> None:
215
- # No additional validation needed for blobs
216
- pass
217
-
218
-
219
- class _IndirectStringPacker(_Packer):
220
- @classmethod
221
- def pack(cls, string: str) -> bytes:
222
- return bytes()
223
-
224
- @classmethod
225
- def unpack(cls, raw_bytes: bytes, start_idx: int) -> Tuple[str, int]:
226
- return "", 0
227
-
228
- @property
229
- def _format_code(self) -> str:
230
- """Get the format code for struct package."""
231
- raise NotImplementedError()
232
-
233
- @property
234
- def _element_size(self) -> int:
235
- """Get the element size (in bytes) of the packer."""
236
- raise NotImplementedError()
237
-
238
- @property
239
- def _caster(self) -> int:
240
- """Get the method for casting the element."""
241
- raise NotImplementedError()
242
-
243
- def _validator(self, element: Any) -> None:
244
- # No additional validation needed for indirect strings
245
- pass
246
-
247
-
248
- class _IndirectBlobPacker(_Packer):
249
- @classmethod
250
- def pack(cls, blob: bytes) -> bytes:
251
- return bytes()
252
-
253
- @classmethod
254
- def unpack(cls, raw_bytes: bytes, start_idx: int) -> Tuple[bytes, int]:
255
- return bytes(), 0
256
-
257
- @property
258
- def _format_code(self) -> str:
259
- """Get the format code for struct package."""
260
- raise NotImplementedError()
261
-
262
- @property
263
- def _element_size(self) -> int:
264
- """Get the element size (in bytes) of the packer."""
265
- raise NotImplementedError()
266
-
267
- @property
268
- def _caster(self) -> int:
269
- """Get the method for casting the element."""
270
- raise NotImplementedError()
271
-
272
- def _validator(self, element: Any) -> None:
273
- # No additional validation needed for indirect blobs
274
- pass
275
-
276
-
277
- class _BoolTruePacker(_Packer):
278
- @classmethod
279
- def pack(cls, element: bool) -> bytes:
280
- return bytes()
281
-
282
- @classmethod
283
- def unpack(cls, raw_bytes: bytes, start_idx: int) -> Tuple[bool, int]:
284
- return True, 0
285
-
286
- @property
287
- def _format_code(self) -> str:
288
- """Get the format code for struct package."""
289
- raise NotImplementedError()
290
-
291
- @property
292
- def _element_size(self) -> int:
293
- """Get the element size (in bytes) of the packer."""
294
- raise NotImplementedError()
295
-
296
- @property
297
- def _caster(self) -> int:
298
- """Get the method for casting the element."""
299
- raise NotImplementedError()
300
-
301
- def _validator(self, element: Any) -> None:
302
- # No additional validation needed for boolean true types
303
- pass
304
-
305
-
306
- class _BoolFalsePacker(_Packer):
307
- @classmethod
308
- def pack(cls, element: bool) -> bytes:
309
- return bytes()
310
-
311
- @classmethod
312
- def unpack(cls, raw_bytes: bytes, start_idx: int) -> Tuple[bool, int]:
313
- return False, 0
314
-
315
- @property
316
- def _format_code(self) -> str:
317
- """Get the format code for struct package."""
318
- raise NotImplementedError()
319
-
320
- @property
321
- def _element_size(self) -> int:
322
- """Get the element size (in bytes) of the packer."""
323
- raise NotImplementedError()
324
-
325
- @property
326
- def _caster(self) -> int:
327
- """Get the method for casting the element."""
328
- raise NotImplementedError()
329
-
330
- def _validator(self, element: Any) -> None:
331
- # No additional validation needed for boolean false types
332
- pass
333
-
334
-
335
- class _EmptyStringPacker(_Packer):
336
- @classmethod
337
- def pack(cls, element: str) -> bytes:
338
- return bytes()
339
-
340
- @classmethod
341
- def unpack(cls, raw_bytes: bytes, start_idx: int) -> Tuple[str, int]:
342
- return "", 0
343
-
344
- @property
345
- def _format_code(self) -> str:
346
- """Get the format code for struct package."""
347
- raise NotImplementedError()
348
-
349
- @property
350
- def _element_size(self) -> int:
351
- """Get the element size (in bytes) of the packer."""
352
- raise NotImplementedError()
353
-
354
- @property
355
- def _caster(self) -> int:
356
- """Get the method for casting the element."""
357
- raise NotImplementedError()
358
-
359
- def _validator(self, element: Any) -> None:
360
- # No additional validation needed for empty strings
361
- pass
362
-
363
-
364
- class _NullPacker(_Packer):
365
- @classmethod
366
- def pack(cls, element: str) -> bytes:
367
- return bytes()
368
-
369
- @classmethod
370
- def unpack(cls, raw_bytes: bytes, start_idx: int) -> Tuple[None, int]:
371
- return None, 0
372
-
373
- @property
374
- def _format_code(self) -> str:
375
- """Get the format code for struct package."""
376
- raise NotImplementedError()
377
-
378
- @property
379
- def _element_size(self) -> int:
380
- """Get the element size (in bytes) of the packer."""
381
- raise NotImplementedError()
382
-
383
- @property
384
- def _caster(self) -> int:
385
- """Get the method for casting the element."""
386
- raise NotImplementedError()
387
-
388
- def _validator(self, element: Any) -> None:
389
- # No additional validation needed for nulls
390
- pass
391
-
392
-
393
- class _Int0Packer(_Packer):
394
- @classmethod
395
- def pack(cls, element: str) -> bytes:
396
- return bytes()
397
-
398
- @classmethod
399
- def unpack(cls, raw_bytes: bytes, start_idx: int) -> Tuple[int, int]:
400
- return 0, 0
401
-
402
- @property
403
- def _format_code(self) -> str:
404
- """Get the format code for struct package."""
405
- raise NotImplementedError()
406
-
407
- @property
408
- def _element_size(self) -> int:
409
- """Get the element size (in bytes) of the packer."""
410
- raise NotImplementedError()
411
-
412
- @property
413
- def _caster(self) -> int:
414
- """Get the method for casting the element."""
415
- raise NotImplementedError()
416
-
417
- def _validator(self, element: Any) -> None:
418
- # No additional validation needed for int 0
419
- pass
420
-
421
-
422
- def _validate_integer(element: Any, num_bits: int, signed: bool) -> None:
423
- """Validate whether this integer is in bounds given it's AMPFieldType."""
424
- max_val = max_int(num_bits, signed)
425
- min_val = min_int(num_bits, signed)
426
-
427
- if element < min_val or element > max_val:
428
- raise ValueError(
429
- f"{'Signed' if signed else 'Unsigned'} integer with {num_bits} bits must fall in the range of {min_val} to {max_val}."
430
- )
431
-
432
-
433
- def _validate_float(element: Any, exp, digit) -> None:
434
- """Validate whether this float is in bounds given it's AMPFieldType."""
435
- # TODO potentially validate for floats with exponent less than -38 and for doubles with exponent less than -308
436
- limit = float_limit(exp, digit)
437
- dec_element = Decimal(str(element))
438
-
439
- if dec_element < -limit or dec_element > limit:
440
- raise ValueError(f"Float must fall in the range of -{limit} to {limit}.")
441
-
442
-
443
- @lru_cache()
444
- def min_int(num_bits: int, signed: bool) -> int:
445
- """Calculate the minimum value that an integer can be considering it's bit length and whether it is signed."""
446
- return signed * -1 * (2 ** (num_bits - 1))
447
-
448
-
449
- @lru_cache()
450
- def max_int(num_bits: int, signed: bool) -> int:
451
- """Calculate the maximum value that an integer can be considering it's bit length and whether it is signed."""
452
- return 2 ** (num_bits - (1 * signed)) - 1
453
-
454
-
455
- @lru_cache()
456
- def float_limit(exp: float, digit: float) -> "Decimal":
457
- """Calculate the limit of a float given it's exponent and digit."""
458
- return Decimal(str(exp)) * Decimal(str(digit))
@@ -1,204 +0,0 @@
1
- # Copyright (C) 2022 Alteryx, Inc. All rights reserved.
2
- #
3
- # Licensed under the ALTERYX SDK AND API LICENSE AGREEMENT;
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
- # https://www.alteryx.com/alteryx-sdk-and-api-license-agreement
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
- """Record building utilities for converting between core and protobuf."""
15
- from typing import Any, Dict, List, Sequence
16
-
17
- from another_ayx_python_sdk.core.constants import NULL_VALUE_PLACEHOLDER
18
- from another_ayx_python_sdk.core.field import FieldType
19
- from another_ayx_python_sdk.core.metadata import Metadata
20
- from another_ayx_python_sdk.providers.amp_provider.builders.packers import (
21
- _BlobPacker,
22
- _BoolFalsePacker,
23
- _BoolPacker,
24
- _BoolTruePacker,
25
- _BytePacker,
26
- _DatePacker,
27
- _DatetimePacker,
28
- _DoublePacker,
29
- _EmptyStringPacker,
30
- _FloatPacker,
31
- _IndirectBlobPacker,
32
- _IndirectStringPacker,
33
- _Int0Packer,
34
- _Int16Packer,
35
- _IntegerPacker,
36
- _LongIntegerPacker,
37
- _NullPacker,
38
- _Packer,
39
- _StringPacker,
40
- )
41
- from another_ayx_python_sdk.providers.amp_provider.resources.generated.record_packet_pb2 import (
42
- AMPFieldType,
43
- Record as ProtobufRecord,
44
- )
45
-
46
-
47
- class RecordBuilder:
48
- """Utilities for converting records between protobuf and core format objects."""
49
-
50
- _field_type_to_packer: Dict[Any, _Packer] = {
51
- AMPFieldType.STRING: _StringPacker(),
52
- AMPFieldType.BLOB: _BlobPacker(),
53
- AMPFieldType.SPATIALOBJ: _BlobPacker(),
54
- AMPFieldType.BCD: _BlobPacker(),
55
- AMPFieldType.BOOL: _BoolPacker(),
56
- AMPFieldType.INT0: _Int0Packer(),
57
- AMPFieldType.UINT8: _BytePacker(),
58
- AMPFieldType.INT16: _Int16Packer(),
59
- AMPFieldType.INT32: _IntegerPacker(),
60
- AMPFieldType.INT64: _LongIntegerPacker(),
61
- AMPFieldType.FLOAT: _FloatPacker(),
62
- AMPFieldType.DOUBLE: _DoublePacker(),
63
- AMPFieldType.DATE: _DatePacker(),
64
- AMPFieldType.TIME: _IntegerPacker(),
65
- AMPFieldType.DATETIME: _DatetimePacker(),
66
- AMPFieldType.INDIRECTSTRING: _IndirectStringPacker(),
67
- AMPFieldType.INDIRECTBLOB: _IndirectBlobPacker(),
68
- AMPFieldType.INDIRECTSPATIAL: _IndirectBlobPacker(),
69
- AMPFieldType.BOOLFALSE: _BoolFalsePacker(),
70
- AMPFieldType.BOOLTRUE: _BoolTruePacker(),
71
- AMPFieldType.EMPTYSTRING: _EmptyStringPacker(),
72
- AMPFieldType.NULL: _NullPacker(),
73
- }
74
-
75
- _blob_cosmetic_types_to_amp_type = {
76
- FieldType.blob: AMPFieldType.BLOB,
77
- FieldType.spatialobj: AMPFieldType.SPATIALOBJ,
78
- FieldType.fixeddecimal: AMPFieldType.BCD,
79
- }
80
-
81
- _datetime_cosmetic_types_to_amp_type = {
82
- FieldType.date: AMPFieldType.DATE,
83
- FieldType.datetime: AMPFieldType.DATETIME,
84
- FieldType.time: AMPFieldType.TIME,
85
- }
86
-
87
- _float_cosmetic_types_to_amp_type = {
88
- FieldType.float: AMPFieldType.FLOAT,
89
- FieldType.double: AMPFieldType.DOUBLE,
90
- }
91
-
92
- _int_cosmetic_types_to_amp_type = {
93
- FieldType.byte: AMPFieldType.UINT8,
94
- FieldType.int16: AMPFieldType.INT16,
95
- FieldType.int32: AMPFieldType.INT32,
96
- FieldType.int64: AMPFieldType.INT64,
97
- }
98
-
99
- _null_values = {NULL_VALUE_PLACEHOLDER, None}
100
-
101
- @classmethod
102
- def from_protobuf(cls, record: ProtobufRecord) -> List:
103
- """
104
- Convert a protobuf to a list of values.
105
-
106
- Parameters
107
- ----------
108
- record
109
- Protobuf representation of a record.
110
-
111
- Returns
112
- -------
113
- List
114
- All elements of the record as a list.
115
- """
116
- start_byte_idx = 0
117
- parsed_record = []
118
-
119
- for amp_type in record.types:
120
- try:
121
- packer = cls._field_type_to_packer[amp_type]
122
- except KeyError:
123
- raise ValueError(f"Packer not found for type: {amp_type}")
124
-
125
- element, stride = packer.unpack(record.data, start_byte_idx)
126
-
127
- parsed_record.append(element)
128
- start_byte_idx += stride
129
-
130
- return parsed_record
131
-
132
- @classmethod
133
- def to_protobuf(cls, record: Sequence, metadata: Metadata) -> ProtobufRecord:
134
- """
135
- Convert a sequence of values to a protobuf.
136
-
137
- Parameters
138
- ----------
139
- record
140
- A sequence of values.
141
- metadata
142
- Metadata associated with the values.
143
-
144
- Returns
145
- -------
146
- ProtobufRecord
147
- The protobuf representation of the passed in record.
148
- """
149
- assert len(record) == len(metadata)
150
-
151
- raw_data = bytes()
152
- amp_types = []
153
- for field, element in zip(metadata, record):
154
- try:
155
- amp_type = cls._get_amp_type(field.type, element)
156
- packer = cls._field_type_to_packer[amp_type]
157
- except KeyError:
158
- raise ValueError(f"Packer not found for type: {field.type}")
159
-
160
- raw_data += packer.pack(element)
161
- amp_types.append(amp_type)
162
-
163
- return ProtobufRecord(data=raw_data, types=amp_types)
164
-
165
- @classmethod
166
- def _get_amp_type(cls, cosmetic_type: FieldType, element: Any) -> AMPFieldType:
167
- if element in cls._null_values:
168
- return AMPFieldType.NULL
169
-
170
- if cosmetic_type in [
171
- FieldType.string,
172
- FieldType.v_string,
173
- FieldType.v_wstring,
174
- FieldType.wstring,
175
- ]:
176
- if element == "":
177
- return AMPFieldType.EMPTYSTRING
178
-
179
- return AMPFieldType.STRING
180
-
181
- if cosmetic_type in cls._blob_cosmetic_types_to_amp_type:
182
- return cls._blob_cosmetic_types_to_amp_type[cosmetic_type]
183
-
184
- if cosmetic_type == FieldType.bool:
185
- if element:
186
- return AMPFieldType.BOOLTRUE
187
-
188
- return AMPFieldType.BOOLFALSE
189
-
190
- if element == 0:
191
- return AMPFieldType.INT0
192
-
193
- if cosmetic_type in cls._float_cosmetic_types_to_amp_type:
194
- return cls._float_cosmetic_types_to_amp_type[cosmetic_type]
195
-
196
- if cosmetic_type in cls._datetime_cosmetic_types_to_amp_type:
197
- return cls._datetime_cosmetic_types_to_amp_type[cosmetic_type]
198
-
199
- if cosmetic_type in cls._int_cosmetic_types_to_amp_type:
200
- return cls._int_cosmetic_types_to_amp_type[cosmetic_type]
201
-
202
- raise ValueError(
203
- f"AMP field type not found for cosmetic type {cosmetic_type} and value {element}."
204
- )