another-ayx-python-sdk 2.4.2__py3-none-any.whl → 2.4.22__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.
- another_ayx_python_sdk/version.py +3 -3
- {another_ayx_python_sdk-2.4.2.dist-info → another_ayx_python_sdk-2.4.22.dist-info}/METADATA +1 -1
- another_ayx_python_sdk-2.4.22.dist-info/RECORD +813 -0
- {another_ayx_python_sdk-2.4.2.dist-info → another_ayx_python_sdk-2.4.22.dist-info}/top_level.txt +2 -0
- build/lib/another_ayx_python_sdk/__init__.py +14 -0
- build/lib/another_ayx_python_sdk/__main__.py +470 -0
- build/lib/another_ayx_python_sdk/assets/workspace_files/__init__.py +14 -0
- build/lib/another_ayx_python_sdk/assets/workspace_files/setup.py +38 -0
- build/lib/another_ayx_python_sdk/cli/__init__.py +14 -0
- build/lib/another_ayx_python_sdk/cli/utilities.py +103 -0
- build/lib/another_ayx_python_sdk/cli/workspace.py +266 -0
- build/lib/another_ayx_python_sdk/cli/yxi_builder.py +125 -0
- build/lib/another_ayx_python_sdk/cli/yxi_installer.py +45 -0
- build/lib/another_ayx_python_sdk/core/__init__.py +51 -0
- build/lib/another_ayx_python_sdk/core/constants.py +25 -0
- build/lib/another_ayx_python_sdk/core/dcm_base.py +115 -0
- build/lib/another_ayx_python_sdk/core/doc_utilities.py +40 -0
- build/lib/another_ayx_python_sdk/core/environment_base.py +213 -0
- build/lib/another_ayx_python_sdk/core/exceptions.py +59 -0
- build/lib/another_ayx_python_sdk/core/field.py +183 -0
- build/lib/another_ayx_python_sdk/core/input_anchor_base.py +86 -0
- build/lib/another_ayx_python_sdk/core/input_connection_base.py +206 -0
- build/lib/another_ayx_python_sdk/core/io_base.py +139 -0
- build/lib/another_ayx_python_sdk/core/metadata.py +173 -0
- build/lib/another_ayx_python_sdk/core/observable_mixin.py +90 -0
- build/lib/another_ayx_python_sdk/core/output_anchor_base.py +151 -0
- build/lib/another_ayx_python_sdk/core/plugin.py +108 -0
- build/lib/another_ayx_python_sdk/core/plugin_v2.py +97 -0
- build/lib/another_ayx_python_sdk/core/provider_base.py +125 -0
- build/lib/another_ayx_python_sdk/core/proxy_requests.py +51 -0
- build/lib/another_ayx_python_sdk/core/record_packet.py +88 -0
- build/lib/another_ayx_python_sdk/core/record_packet_base.py +123 -0
- build/lib/another_ayx_python_sdk/core/register_plugin.py +127 -0
- build/lib/another_ayx_python_sdk/core/testing.py +191 -0
- build/lib/another_ayx_python_sdk/core/utils.py +146 -0
- build/lib/another_ayx_python_sdk/examples/AyxSdkInput/main.py +89 -0
- build/lib/another_ayx_python_sdk/examples/AyxSdkMultiConnectionsMultiOutputAnchor/main.py +102 -0
- build/lib/another_ayx_python_sdk/examples/AyxSdkMultipleInputAnchors/main.py +84 -0
- build/lib/another_ayx_python_sdk/examples/AyxSdkMultipleOutputAnchors/main.py +96 -0
- build/lib/another_ayx_python_sdk/examples/AyxSdkOptionalInputAnchor/main.py +94 -0
- build/lib/another_ayx_python_sdk/examples/AyxSdkOutput/main.py +78 -0
- build/lib/another_ayx_python_sdk/examples/AyxSdkPassThrough/main.py +82 -0
- build/lib/another_ayx_python_sdk/providers/__init__.py +14 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/__init__.py +41 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/__main__.py +85 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/amp_dcm.py +58 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/amp_driver.py +358 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/amp_environment.py +73 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/amp_environment_v2.py +278 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/amp_input_anchor.py +73 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/amp_input_connection.py +132 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/amp_io.py +64 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/amp_io_components.py +407 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/amp_output_anchor.py +107 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/amp_provider.py +68 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/amp_provider_v2.py +128 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/amp_record_packet.py +21 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/builders/__init__.py +32 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/builders/input_anchor_builder.py +123 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/builders/input_connection_builder.py +95 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/builders/metadata_builder.py +118 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/builders/output_anchor_builder.py +110 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/builders/packers.py +458 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/builders/record_builder.py +204 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/builders/record_packet_builder.py +133 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/builders/tool_config_builder.py +59 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/cng_certs.py +197 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/data_transport/__init__.py +18 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/data_transport/amp_transport.py +127 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/data_transport/transport_base.py +35 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/grpc_helpers/__init__.py +14 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/grpc_helpers/control_msgs.py +189 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/grpc_helpers/dcme_msgs.py +119 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/grpc_helpers/record_transfer_msgs.py +32 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/grpc_util.py +161 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/logger_config.py +63 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/plugin_class_loader.py +77 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/__init__.py +67 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/dcm_repository.py +252 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/environment_repository.py +212 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/grpc_repository.py +119 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/input_anchor_repository.py +110 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/input_connection_repository.py +276 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/input_metadata_repository.py +144 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/input_record_packet_repository.py +252 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/io_repository.py +188 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/output_anchor_repository.py +117 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/output_metadata_repository.py +129 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/output_record_packet_repository.py +170 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/plugin_class_repository.py +55 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/singleton.py +32 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/test_harness_state_repository.py +172 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/tool_config_repository.py +89 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/__init__.py +14 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/__init__.py +0 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/close_outgoing_anchor_pb2.py +25 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/close_outgoing_anchor_pb2_grpc.py +4 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/dcm_e_pb2.py +38 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/dcm_e_pb2_grpc.py +4 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/incoming_anchor_pb2.py +26 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/incoming_anchor_pb2_grpc.py +4 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/incoming_connection_complete_pb2.py +25 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/incoming_connection_complete_pb2_grpc.py +4 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/incoming_connection_pb2.py +26 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/incoming_connection_pb2_grpc.py +4 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/incoming_data_push_pb2.py +26 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/incoming_data_push_pb2_grpc.py +4 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/incoming_record_packet_push_pb2.py +26 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/incoming_record_packet_push_pb2_grpc.py +4 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/metadata_pb2.py +31 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/metadata_pb2_grpc.py +4 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/outgoing_anchor_pb2.py +28 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/outgoing_anchor_pb2_grpc.py +4 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/outgoing_data_push_pb2.py +26 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/outgoing_data_push_pb2_grpc.py +4 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/outgoing_metadata_push_pb2.py +26 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/outgoing_metadata_push_pb2_grpc.py +4 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/outgoing_record_packet_push_pb2.py +26 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/outgoing_record_packet_push_pb2_grpc.py +4 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/output_message_data_pb2.py +29 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/output_message_data_pb2_grpc.py +4 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/password_data_pb2.py +25 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/password_data_pb2_grpc.py +4 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/plugin_initialization_data_pb2.py +33 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/plugin_initialization_data_pb2_grpc.py +4 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/record_batch_pb2.py +25 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/record_batch_pb2_grpc.py +4 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/record_packet_pb2.py +29 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/record_packet_pb2_grpc.py +4 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/sdk_engine_service_pb2.py +34 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/sdk_engine_service_pb2_grpc.py +305 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/sdk_tool_service_pb2.py +30 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/sdk_tool_service_pb2_grpc.py +235 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/sdk_tool_service_startup_info_pb2.py +25 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/sdk_tool_service_startup_info_pb2_grpc.py +4 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/sdk_tool_service_v2_pb2.py +54 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/sdk_tool_service_v2_pb2_grpc.py +99 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/translate_message_data_pb2.py +27 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/translate_message_data_pb2_grpc.py +4 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/transport_pb2.py +31 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/transport_pb2_grpc.py +4 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/update_progress_pb2.py +25 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/update_progress_pb2_grpc.py +4 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/sdk_tool_runner.py +115 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/sdk_tool_service.py +207 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/sdk_tool_service_v2.py +306 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/utilities/__init__.py +14 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/utilities/constants.py +22 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/utilities/conversions.py +55 -0
- build/lib/another_ayx_python_sdk/providers/amp_provider/utilities/utilities.py +63 -0
- build/lib/another_ayx_python_sdk/providers/e1_provider/__init__.py +36 -0
- build/lib/another_ayx_python_sdk/providers/e1_provider/anchor_builder.py +95 -0
- build/lib/another_ayx_python_sdk/providers/e1_provider/cache_e1_sdk_import.py +31 -0
- build/lib/another_ayx_python_sdk/providers/e1_provider/connection_callback_strategy.py +155 -0
- build/lib/another_ayx_python_sdk/providers/e1_provider/connection_interface.py +125 -0
- build/lib/another_ayx_python_sdk/providers/e1_provider/e1_dcm.py +53 -0
- build/lib/another_ayx_python_sdk/providers/e1_provider/e1_environment.py +127 -0
- build/lib/another_ayx_python_sdk/providers/e1_provider/e1_input_anchor.py +51 -0
- build/lib/another_ayx_python_sdk/providers/e1_provider/e1_input_anchor_proxy.py +33 -0
- build/lib/another_ayx_python_sdk/providers/e1_provider/e1_input_connection.py +87 -0
- build/lib/another_ayx_python_sdk/providers/e1_provider/e1_io.py +71 -0
- build/lib/another_ayx_python_sdk/providers/e1_provider/e1_output_anchor.py +157 -0
- build/lib/another_ayx_python_sdk/providers/e1_provider/e1_output_anchor_proxy.py +97 -0
- build/lib/another_ayx_python_sdk/providers/e1_provider/e1_plugin_driver.py +63 -0
- build/lib/another_ayx_python_sdk/providers/e1_provider/e1_plugin_proxy.py +363 -0
- build/lib/another_ayx_python_sdk/providers/e1_provider/e1_provider.py +71 -0
- build/lib/another_ayx_python_sdk/providers/e1_provider/e1_record_packet.py +21 -0
- build/lib/another_ayx_python_sdk/providers/e1_provider/events.py +36 -0
- build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/AlteryxPythonSDK/__init__.py +37 -0
- build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/AlteryxPythonSDK/alteryx_engine.py +105 -0
- build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/AlteryxPythonSDK/constants.py +50 -0
- build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/AlteryxPythonSDK/field.py +122 -0
- build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/AlteryxPythonSDK/output_anchor.py +55 -0
- build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/AlteryxPythonSDK/output_anchor_manager.py +31 -0
- build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/AlteryxPythonSDK/record_copier.py +65 -0
- build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/AlteryxPythonSDK/record_creator.py +41 -0
- build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/AlteryxPythonSDK/record_info.py +134 -0
- build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/AlteryxPythonSDK/record_ref.py +42 -0
- build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/AlteryxPythonSDK/tool.py +29 -0
- build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/AlteryxPythonSDK/tool_execution_info.py +43 -0
- build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/__init__.py +14 -0
- build/lib/another_ayx_python_sdk/providers/e1_provider/proxies/__init__.py +18 -0
- build/lib/another_ayx_python_sdk/providers/e1_provider/proxies/field_proxy.py +109 -0
- build/lib/another_ayx_python_sdk/providers/e1_provider/proxies/record_copier_proxy.py +49 -0
- build/lib/another_ayx_python_sdk/providers/e1_provider/records/__init__.py +23 -0
- build/lib/another_ayx_python_sdk/providers/e1_provider/records/base_record_container.py +47 -0
- build/lib/another_ayx_python_sdk/providers/e1_provider/records/parsed_record_container.py +67 -0
- build/lib/another_ayx_python_sdk/providers/e1_provider/records/raw_record_container.py +111 -0
- build/lib/another_ayx_python_sdk/providers/e1_provider/tool_config_loader.py +132 -0
- build/lib/another_ayx_python_sdk/providers/e1_provider/utilities/__init__.py +35 -0
- build/lib/another_ayx_python_sdk/providers/e1_provider/utilities/utilities.py +54 -0
- build/lib/another_ayx_python_sdk/providers/e1_provider/workflow_config.py +31 -0
- build/lib/another_ayx_python_sdk/providers/file_provider/__init__.py +32 -0
- build/lib/another_ayx_python_sdk/providers/file_provider/environment.py +131 -0
- build/lib/another_ayx_python_sdk/providers/file_provider/file_adapter.py +286 -0
- build/lib/another_ayx_python_sdk/providers/file_provider/file_provider.py +185 -0
- build/lib/another_ayx_python_sdk/providers/file_provider/file_provider_dcm.py +53 -0
- build/lib/another_ayx_python_sdk/providers/file_provider/file_provider_input_anchor.py +70 -0
- build/lib/another_ayx_python_sdk/providers/file_provider/file_provider_input_connection.py +112 -0
- build/lib/another_ayx_python_sdk/providers/file_provider/file_provider_output_anchor.py +114 -0
- build/lib/another_ayx_python_sdk/providers/file_provider/file_record_packet.py +21 -0
- build/lib/another_ayx_python_sdk/providers/file_provider/iox.py +56 -0
- build/lib/another_ayx_python_sdk/providers/file_provider/tool_input.py +104 -0
- build/lib/another_ayx_python_sdk/test_harness/__init__.py +14 -0
- build/lib/another_ayx_python_sdk/test_harness/__main__.py +120 -0
- build/lib/another_ayx_python_sdk/test_harness/plugin_runner.py +416 -0
- build/lib/another_ayx_python_sdk/test_harness/process_lifecycle_manager.py +80 -0
- build/lib/another_ayx_python_sdk/test_harness/sdk_engine_service.py +106 -0
- build/lib/another_ayx_python_sdk/version.py +8 -0
- build/lib/build/lib/another_ayx_python_sdk/__init__.py +14 -0
- build/lib/build/lib/another_ayx_python_sdk/__main__.py +470 -0
- build/lib/build/lib/another_ayx_python_sdk/assets/workspace_files/__init__.py +14 -0
- build/lib/build/lib/another_ayx_python_sdk/assets/workspace_files/setup.py +38 -0
- build/lib/build/lib/another_ayx_python_sdk/cli/__init__.py +14 -0
- build/lib/build/lib/another_ayx_python_sdk/cli/utilities.py +103 -0
- build/lib/build/lib/another_ayx_python_sdk/cli/workspace.py +266 -0
- build/lib/build/lib/another_ayx_python_sdk/cli/yxi_builder.py +125 -0
- build/lib/build/lib/another_ayx_python_sdk/cli/yxi_installer.py +45 -0
- build/lib/build/lib/another_ayx_python_sdk/core/__init__.py +51 -0
- build/lib/build/lib/another_ayx_python_sdk/core/constants.py +25 -0
- build/lib/build/lib/another_ayx_python_sdk/core/dcm_base.py +115 -0
- build/lib/build/lib/another_ayx_python_sdk/core/doc_utilities.py +40 -0
- build/lib/build/lib/another_ayx_python_sdk/core/environment_base.py +213 -0
- build/lib/build/lib/another_ayx_python_sdk/core/exceptions.py +59 -0
- build/lib/build/lib/another_ayx_python_sdk/core/field.py +183 -0
- build/lib/build/lib/another_ayx_python_sdk/core/input_anchor_base.py +86 -0
- build/lib/build/lib/another_ayx_python_sdk/core/input_connection_base.py +206 -0
- build/lib/build/lib/another_ayx_python_sdk/core/io_base.py +139 -0
- build/lib/build/lib/another_ayx_python_sdk/core/metadata.py +173 -0
- build/lib/build/lib/another_ayx_python_sdk/core/observable_mixin.py +90 -0
- build/lib/build/lib/another_ayx_python_sdk/core/output_anchor_base.py +151 -0
- build/lib/build/lib/another_ayx_python_sdk/core/plugin.py +108 -0
- build/lib/build/lib/another_ayx_python_sdk/core/plugin_v2.py +97 -0
- build/lib/build/lib/another_ayx_python_sdk/core/provider_base.py +125 -0
- build/lib/build/lib/another_ayx_python_sdk/core/proxy_requests.py +51 -0
- build/lib/build/lib/another_ayx_python_sdk/core/record_packet.py +88 -0
- build/lib/build/lib/another_ayx_python_sdk/core/record_packet_base.py +123 -0
- build/lib/build/lib/another_ayx_python_sdk/core/register_plugin.py +127 -0
- build/lib/build/lib/another_ayx_python_sdk/core/testing.py +191 -0
- build/lib/build/lib/another_ayx_python_sdk/core/utils.py +146 -0
- build/lib/build/lib/another_ayx_python_sdk/examples/AyxSdkInput/main.py +89 -0
- build/lib/build/lib/another_ayx_python_sdk/examples/AyxSdkMultiConnectionsMultiOutputAnchor/main.py +102 -0
- build/lib/build/lib/another_ayx_python_sdk/examples/AyxSdkMultipleInputAnchors/main.py +84 -0
- build/lib/build/lib/another_ayx_python_sdk/examples/AyxSdkMultipleOutputAnchors/main.py +96 -0
- build/lib/build/lib/another_ayx_python_sdk/examples/AyxSdkOptionalInputAnchor/main.py +94 -0
- build/lib/build/lib/another_ayx_python_sdk/examples/AyxSdkOutput/main.py +78 -0
- build/lib/build/lib/another_ayx_python_sdk/examples/AyxSdkPassThrough/main.py +82 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/__init__.py +14 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/__init__.py +41 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/__main__.py +85 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/amp_dcm.py +58 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/amp_driver.py +358 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/amp_environment.py +73 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/amp_environment_v2.py +278 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/amp_input_anchor.py +73 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/amp_input_connection.py +132 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/amp_io.py +64 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/amp_io_components.py +407 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/amp_output_anchor.py +107 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/amp_provider.py +68 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/amp_provider_v2.py +128 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/amp_record_packet.py +21 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/builders/__init__.py +32 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/builders/input_anchor_builder.py +123 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/builders/input_connection_builder.py +95 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/builders/metadata_builder.py +118 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/builders/output_anchor_builder.py +110 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/builders/packers.py +458 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/builders/record_builder.py +204 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/builders/record_packet_builder.py +133 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/builders/tool_config_builder.py +59 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/cng_certs.py +197 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/data_transport/__init__.py +18 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/data_transport/amp_transport.py +127 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/data_transport/transport_base.py +35 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/grpc_helpers/__init__.py +14 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/grpc_helpers/control_msgs.py +189 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/grpc_helpers/dcme_msgs.py +119 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/grpc_helpers/record_transfer_msgs.py +32 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/grpc_util.py +161 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/logger_config.py +63 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/plugin_class_loader.py +77 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/__init__.py +67 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/dcm_repository.py +252 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/environment_repository.py +212 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/grpc_repository.py +119 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/input_anchor_repository.py +110 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/input_connection_repository.py +276 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/input_metadata_repository.py +144 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/input_record_packet_repository.py +252 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/io_repository.py +188 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/output_anchor_repository.py +117 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/output_metadata_repository.py +129 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/output_record_packet_repository.py +170 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/plugin_class_repository.py +55 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/singleton.py +32 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/test_harness_state_repository.py +172 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/tool_config_repository.py +89 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/resources/__init__.py +14 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/__init__.py +0 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/close_outgoing_anchor_pb2.py +25 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/close_outgoing_anchor_pb2_grpc.py +4 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/dcm_e_pb2.py +38 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/dcm_e_pb2_grpc.py +4 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/incoming_anchor_pb2.py +26 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/incoming_anchor_pb2_grpc.py +4 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/incoming_connection_complete_pb2.py +25 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/incoming_connection_complete_pb2_grpc.py +4 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/incoming_connection_pb2.py +26 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/incoming_connection_pb2_grpc.py +4 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/incoming_data_push_pb2.py +26 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/incoming_data_push_pb2_grpc.py +4 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/incoming_record_packet_push_pb2.py +26 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/incoming_record_packet_push_pb2_grpc.py +4 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/metadata_pb2.py +31 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/metadata_pb2_grpc.py +4 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/outgoing_anchor_pb2.py +28 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/outgoing_anchor_pb2_grpc.py +4 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/outgoing_data_push_pb2.py +26 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/outgoing_data_push_pb2_grpc.py +4 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/outgoing_metadata_push_pb2.py +26 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/outgoing_metadata_push_pb2_grpc.py +4 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/outgoing_record_packet_push_pb2.py +26 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/outgoing_record_packet_push_pb2_grpc.py +4 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/output_message_data_pb2.py +29 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/output_message_data_pb2_grpc.py +4 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/password_data_pb2.py +25 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/password_data_pb2_grpc.py +4 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/plugin_initialization_data_pb2.py +33 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/plugin_initialization_data_pb2_grpc.py +4 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/record_batch_pb2.py +25 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/record_batch_pb2_grpc.py +4 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/record_packet_pb2.py +29 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/record_packet_pb2_grpc.py +4 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/sdk_engine_service_pb2.py +34 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/sdk_engine_service_pb2_grpc.py +305 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/sdk_tool_service_pb2.py +30 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/sdk_tool_service_pb2_grpc.py +235 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/sdk_tool_service_startup_info_pb2.py +25 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/sdk_tool_service_startup_info_pb2_grpc.py +4 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/sdk_tool_service_v2_pb2.py +54 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/sdk_tool_service_v2_pb2_grpc.py +99 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/translate_message_data_pb2.py +27 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/translate_message_data_pb2_grpc.py +4 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/transport_pb2.py +31 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/transport_pb2_grpc.py +4 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/update_progress_pb2.py +25 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/update_progress_pb2_grpc.py +4 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/sdk_tool_runner.py +115 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/sdk_tool_service.py +207 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/sdk_tool_service_v2.py +306 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/utilities/__init__.py +14 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/utilities/constants.py +22 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/utilities/conversions.py +55 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/utilities/utilities.py +63 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/e1_provider/__init__.py +36 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/e1_provider/anchor_builder.py +95 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/e1_provider/cache_e1_sdk_import.py +31 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/e1_provider/connection_callback_strategy.py +155 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/e1_provider/connection_interface.py +125 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/e1_provider/e1_dcm.py +53 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/e1_provider/e1_environment.py +127 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/e1_provider/e1_input_anchor.py +51 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/e1_provider/e1_input_anchor_proxy.py +33 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/e1_provider/e1_input_connection.py +87 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/e1_provider/e1_io.py +71 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/e1_provider/e1_output_anchor.py +157 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/e1_provider/e1_output_anchor_proxy.py +97 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/e1_provider/e1_plugin_driver.py +63 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/e1_provider/e1_plugin_proxy.py +363 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/e1_provider/e1_provider.py +71 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/e1_provider/e1_record_packet.py +21 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/e1_provider/events.py +36 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/AlteryxPythonSDK/__init__.py +37 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/AlteryxPythonSDK/alteryx_engine.py +105 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/AlteryxPythonSDK/constants.py +50 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/AlteryxPythonSDK/field.py +122 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/AlteryxPythonSDK/output_anchor.py +55 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/AlteryxPythonSDK/output_anchor_manager.py +31 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/AlteryxPythonSDK/record_copier.py +65 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/AlteryxPythonSDK/record_creator.py +41 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/AlteryxPythonSDK/record_info.py +134 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/AlteryxPythonSDK/record_ref.py +42 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/AlteryxPythonSDK/tool.py +29 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/AlteryxPythonSDK/tool_execution_info.py +43 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/__init__.py +14 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/e1_provider/proxies/__init__.py +18 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/e1_provider/proxies/field_proxy.py +109 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/e1_provider/proxies/record_copier_proxy.py +49 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/e1_provider/records/__init__.py +23 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/e1_provider/records/base_record_container.py +47 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/e1_provider/records/parsed_record_container.py +67 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/e1_provider/records/raw_record_container.py +111 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/e1_provider/tool_config_loader.py +132 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/e1_provider/utilities/__init__.py +35 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/e1_provider/utilities/utilities.py +54 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/e1_provider/workflow_config.py +31 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/file_provider/__init__.py +32 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/file_provider/environment.py +131 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/file_provider/file_adapter.py +286 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/file_provider/file_provider.py +185 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/file_provider/file_provider_dcm.py +53 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/file_provider/file_provider_input_anchor.py +70 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/file_provider/file_provider_input_connection.py +112 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/file_provider/file_provider_output_anchor.py +114 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/file_provider/file_record_packet.py +21 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/file_provider/iox.py +56 -0
- build/lib/build/lib/another_ayx_python_sdk/providers/file_provider/tool_input.py +104 -0
- build/lib/build/lib/another_ayx_python_sdk/test_harness/__init__.py +14 -0
- build/lib/build/lib/another_ayx_python_sdk/test_harness/__main__.py +120 -0
- build/lib/build/lib/another_ayx_python_sdk/test_harness/plugin_runner.py +416 -0
- build/lib/build/lib/another_ayx_python_sdk/test_harness/process_lifecycle_manager.py +80 -0
- build/lib/build/lib/another_ayx_python_sdk/test_harness/sdk_engine_service.py +106 -0
- build/lib/build/lib/another_ayx_python_sdk/version.py +8 -0
- another_ayx_python_sdk-2.4.2.dist-info/RECORD +0 -403
- {another_ayx_python_sdk-2.4.2.dist-info → another_ayx_python_sdk-2.4.22.dist-info}/WHEEL +0 -0
- {another_ayx_python_sdk-2.4.2.dist-info → another_ayx_python_sdk-2.4.22.dist-info}/entry_points.txt +0 -0
- {another_ayx_python_sdk-2.4.2.dist-info → another_ayx_python_sdk-2.4.22.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,128 @@
|
|
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
|
+
"""AMP Provider: SDK Provider class definition."""
|
15
|
+
|
16
|
+
# from AyxPythonSdk.ayx_python_sdk.providers.amp_provider.amp_environment import AMPEnvironment
|
17
|
+
import logging
|
18
|
+
from collections import defaultdict
|
19
|
+
from typing import Any, Dict, TYPE_CHECKING
|
20
|
+
|
21
|
+
from another_ayx_python_sdk.providers.amp_provider.amp_environment_v2 import AMPEnvironmentV2
|
22
|
+
from another_ayx_python_sdk.providers.amp_provider.amp_io_components import (
|
23
|
+
ControlIOBuffer,
|
24
|
+
StreamIOBuffer,
|
25
|
+
)
|
26
|
+
from another_ayx_python_sdk.providers.amp_provider.grpc_helpers.control_msgs import (
|
27
|
+
new_ctrl_out_metadata_msg,
|
28
|
+
new_ctrl_out_save_config,
|
29
|
+
)
|
30
|
+
|
31
|
+
import xmltodict
|
32
|
+
|
33
|
+
if TYPE_CHECKING:
|
34
|
+
from another_ayx_python_sdk.providers.amp_provider.resources.generated.sdk_tool_service_v2_pb2 import (
|
35
|
+
ControlIn,
|
36
|
+
)
|
37
|
+
|
38
|
+
from pyarrow import Schema
|
39
|
+
|
40
|
+
# Update for docs needed since we're not inheriting from legacy ProviderBase now.
|
41
|
+
|
42
|
+
|
43
|
+
class AMPProviderV2:
|
44
|
+
"""Class that provides resources to plugins that are run with the AMP Provider."""
|
45
|
+
|
46
|
+
def __init__(self) -> None:
|
47
|
+
"""Initialize the AMP resource provider."""
|
48
|
+
self.__environment: AMPEnvironmentV2 = AMPEnvironmentV2()
|
49
|
+
self.__ctrl_io: "ControlIOBuffer" = ControlIOBuffer()
|
50
|
+
self.__record_transfer_io: StreamIOBuffer = StreamIOBuffer()
|
51
|
+
self.incoming_anchors: defaultdict = defaultdict(dict)
|
52
|
+
self.outgoing_anchors: dict = {}
|
53
|
+
self.logger = logging.getLogger()
|
54
|
+
|
55
|
+
@property
|
56
|
+
def io(self) -> "ControlIOBuffer": # noqa: D102
|
57
|
+
return self.__ctrl_io
|
58
|
+
|
59
|
+
@property
|
60
|
+
def environment(self) -> "AMPEnvironmentV2": # noqa: D102
|
61
|
+
return self.__environment
|
62
|
+
|
63
|
+
@property
|
64
|
+
def record_io(self) -> "StreamIOBuffer": # noqa: D102
|
65
|
+
return self.__record_transfer_io
|
66
|
+
|
67
|
+
@property
|
68
|
+
def dcm(self) -> "ControlIOBuffer": # noqa: D102
|
69
|
+
return self.__ctrl_io
|
70
|
+
|
71
|
+
@property
|
72
|
+
def tool_config(self) -> Dict:
|
73
|
+
"""
|
74
|
+
Get the tool config from the tool's config UI in Designer.
|
75
|
+
|
76
|
+
Returns
|
77
|
+
-------
|
78
|
+
Dict[str, Any]
|
79
|
+
The Tool Config associated with the current plugin, in the form of a Python dictionary.
|
80
|
+
"""
|
81
|
+
return self.environment.tool_config
|
82
|
+
|
83
|
+
def save_tool_config(self, tool_config: Dict[str, Any]) -> None: # noqa: D102
|
84
|
+
"""
|
85
|
+
Encode the tool configuration as a Python dictionary and send it to Designer.
|
86
|
+
|
87
|
+
Parameters
|
88
|
+
----------
|
89
|
+
tool_config
|
90
|
+
Dictionary form of the Tool Config XML.
|
91
|
+
"""
|
92
|
+
unparsed: str = xmltodict.unparse(
|
93
|
+
{"Configuration": tool_config}, short_empty_elements=True
|
94
|
+
)
|
95
|
+
msg = new_ctrl_out_save_config(unparsed)
|
96
|
+
try:
|
97
|
+
self.__ctrl_io.push_ctrl_out(msg)
|
98
|
+
self.__environment.update_tool_config(tool_config)
|
99
|
+
self.logger.debug(self.__environment.tool_config)
|
100
|
+
except Exception as e:
|
101
|
+
self.__ctrl_io.warn("Failed to update tool config.")
|
102
|
+
self.logger.warn("tool_config save exception was: %s", repr(e))
|
103
|
+
|
104
|
+
def push_outgoing_metadata(
|
105
|
+
self, anchor_name: str, metadata: "Schema"
|
106
|
+
) -> None: # noqa: D102
|
107
|
+
metadata_msg = new_ctrl_out_metadata_msg(anchor_name, metadata)
|
108
|
+
self.__ctrl_io.push_ctrl_out(metadata_msg)
|
109
|
+
|
110
|
+
def write_to_anchor(self, name: str, data: object) -> None: # noqa: D102
|
111
|
+
self.__record_transfer_io.write_to_buffer(name, data)
|
112
|
+
|
113
|
+
def close_outgoing_anchor(self, name: str) -> None: # noqa: D102
|
114
|
+
self.__record_transfer_io.push_close_anchor_msg(name)
|
115
|
+
|
116
|
+
def set_anchors(self, init_request: "ControlIn") -> None: # noqa: D102
|
117
|
+
for anchor in init_request.plugin_initialization_data.incomingAnchors:
|
118
|
+
for conn in anchor.connections:
|
119
|
+
self.incoming_anchors[anchor.name][conn.name] = {
|
120
|
+
"name": conn.name,
|
121
|
+
"metadata": conn.metadata,
|
122
|
+
}
|
123
|
+
for anchor in init_request.plugin_initialization_data.outgoingAnchors:
|
124
|
+
self.outgoing_anchors[anchor.name] = {
|
125
|
+
"name": anchor.name,
|
126
|
+
"metadata": anchor.metadata,
|
127
|
+
"num_connections": anchor.num_connections,
|
128
|
+
}
|
@@ -0,0 +1,21 @@
|
|
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
|
+
"""AMP Provider: Record Packet class definition."""
|
15
|
+
from another_ayx_python_sdk.core import RecordPacket
|
16
|
+
from another_ayx_python_sdk.core.doc_utilities import inherit_docs
|
17
|
+
|
18
|
+
|
19
|
+
@inherit_docs
|
20
|
+
class AMPRecordPacket(RecordPacket):
|
21
|
+
"""AMP Provider: Record Packet class definition."""
|
@@ -0,0 +1,32 @@
|
|
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
|
+
"""Builder methods for converting between core and protobuf objects."""
|
15
|
+
|
16
|
+
from .input_anchor_builder import InputAnchorBuilder
|
17
|
+
from .input_connection_builder import InputConnectionBuilder
|
18
|
+
from .metadata_builder import MetadataBuilder
|
19
|
+
from .output_anchor_builder import OutputAnchorBuilder
|
20
|
+
from .record_builder import RecordBuilder
|
21
|
+
from .record_packet_builder import RecordPacketBuilder
|
22
|
+
from .tool_config_builder import ToolConfigBuilder
|
23
|
+
|
24
|
+
__all__ = [
|
25
|
+
"InputAnchorBuilder",
|
26
|
+
"InputConnectionBuilder",
|
27
|
+
"MetadataBuilder",
|
28
|
+
"RecordBuilder",
|
29
|
+
"RecordPacketBuilder",
|
30
|
+
"OutputAnchorBuilder",
|
31
|
+
"ToolConfigBuilder",
|
32
|
+
]
|
@@ -0,0 +1,123 @@
|
|
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
|
+
"""Class that implements serialization/deserialization for Input Anchors to and from protobuf message format."""
|
15
|
+
import logging
|
16
|
+
from enum import Enum
|
17
|
+
|
18
|
+
from another_ayx_python_sdk.providers.amp_provider.amp_input_anchor import AMPInputAnchor
|
19
|
+
from another_ayx_python_sdk.providers.amp_provider.builders.input_connection_builder import (
|
20
|
+
InputConnectionBuilder,
|
21
|
+
)
|
22
|
+
from another_ayx_python_sdk.providers.amp_provider.resources.generated.incoming_anchor_pb2 import (
|
23
|
+
IncomingAnchor as ProtobufInputAnchor,
|
24
|
+
)
|
25
|
+
|
26
|
+
|
27
|
+
class AnchorOptionsBitmask(Enum):
|
28
|
+
"""Bitfield values for anchor flags."""
|
29
|
+
|
30
|
+
NONE = 0
|
31
|
+
REQUIRED = 1
|
32
|
+
ALLOW_MULTIPLE = 2
|
33
|
+
REQUIRES_SEQUENCE = 4
|
34
|
+
REQUEST_SEQUENCE = 8
|
35
|
+
|
36
|
+
|
37
|
+
logger = logging.getLogger(__name__)
|
38
|
+
|
39
|
+
|
40
|
+
class InputAnchorBuilder:
|
41
|
+
"""RPC Builder for converting protobuf Input Anchors to AMP Input Anchors and vice-versa."""
|
42
|
+
|
43
|
+
_input_connection_builder = InputConnectionBuilder()
|
44
|
+
|
45
|
+
@classmethod
|
46
|
+
def to_protobuf(cls, amp_input_anchor: "AMPInputAnchor") -> ProtobufInputAnchor:
|
47
|
+
"""
|
48
|
+
Serialize AMP input anchor to protobuf objects.
|
49
|
+
|
50
|
+
Parameters
|
51
|
+
----------
|
52
|
+
amp_input_anchor
|
53
|
+
An AMPInputAnchor object to serialize into protobuf.
|
54
|
+
|
55
|
+
Returns
|
56
|
+
-------
|
57
|
+
ProtobufInputAnchor
|
58
|
+
The Protobuf representation of the passed in AMPInputAnchor.
|
59
|
+
"""
|
60
|
+
protobuf_input_anchor = ProtobufInputAnchor()
|
61
|
+
protobuf_input_anchor.name = amp_input_anchor.name
|
62
|
+
logger.debug("Serializing input anchor %s to protobuf", amp_input_anchor.name)
|
63
|
+
for connection in amp_input_anchor.connections:
|
64
|
+
protobuf_connection = cls._input_connection_builder.to_protobuf(connection)
|
65
|
+
protobuf_input_anchor.connections.append(protobuf_connection)
|
66
|
+
logger.debug("Serializing connection %s to protobuf", connection.name)
|
67
|
+
|
68
|
+
protobuf_input_anchor.sequencing = 0
|
69
|
+
if not amp_input_anchor.optional:
|
70
|
+
protobuf_input_anchor.sequencing |= AnchorOptionsBitmask.REQUIRED.value
|
71
|
+
if amp_input_anchor.allow_multiple:
|
72
|
+
protobuf_input_anchor.sequencing |= (
|
73
|
+
AnchorOptionsBitmask.ALLOW_MULTIPLE.value
|
74
|
+
)
|
75
|
+
|
76
|
+
# For now, we only support REQUIRES_SEQUENCE
|
77
|
+
protobuf_input_anchor.sequencing |= AnchorOptionsBitmask.REQUIRES_SEQUENCE.value
|
78
|
+
logger.debug(
|
79
|
+
"Input anchor %s has sequencing options %s",
|
80
|
+
amp_input_anchor.name,
|
81
|
+
bin(protobuf_input_anchor.sequencing),
|
82
|
+
)
|
83
|
+
return protobuf_input_anchor
|
84
|
+
|
85
|
+
@classmethod
|
86
|
+
def from_protobuf(
|
87
|
+
cls, protobuf_input_anchor: ProtobufInputAnchor
|
88
|
+
) -> AMPInputAnchor:
|
89
|
+
"""
|
90
|
+
Deserialize protobuf objects into AMP input anchor.
|
91
|
+
|
92
|
+
Parameters
|
93
|
+
----------
|
94
|
+
protobuf_input_anchor
|
95
|
+
Protobuf object to be serialized into an AMPInputAnchor.
|
96
|
+
|
97
|
+
Returns
|
98
|
+
-------
|
99
|
+
AMPInputAnchor
|
100
|
+
The AMPInputAnchor representation of the protobuf object.
|
101
|
+
"""
|
102
|
+
logger.debug("Deserializing input anchor %s", protobuf_input_anchor.name)
|
103
|
+
allow_multiple = bool(
|
104
|
+
protobuf_input_anchor.sequencing & AnchorOptionsBitmask.ALLOW_MULTIPLE.value
|
105
|
+
)
|
106
|
+
optional = not bool(
|
107
|
+
protobuf_input_anchor.sequencing & AnchorOptionsBitmask.REQUIRED.value
|
108
|
+
)
|
109
|
+
|
110
|
+
amp_input_anchor = AMPInputAnchor(
|
111
|
+
name=protobuf_input_anchor.name,
|
112
|
+
allow_multiple=allow_multiple,
|
113
|
+
optional=optional,
|
114
|
+
)
|
115
|
+
|
116
|
+
for connection in protobuf_input_anchor.connections:
|
117
|
+
input_connection = cls._input_connection_builder.from_protobuf(
|
118
|
+
connection, amp_input_anchor
|
119
|
+
)
|
120
|
+
amp_input_anchor.connections.append(input_connection)
|
121
|
+
logger.debug("Deserialized input connection %s", input_connection.name)
|
122
|
+
|
123
|
+
return amp_input_anchor
|
@@ -0,0 +1,95 @@
|
|
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
|
+
"""Class that implements the serialization/deserialization for input connection protobuf objects."""
|
15
|
+
import logging
|
16
|
+
from typing import TYPE_CHECKING
|
17
|
+
|
18
|
+
from another_ayx_python_sdk.providers.amp_provider.amp_input_connection import (
|
19
|
+
AMPInputConnection,
|
20
|
+
)
|
21
|
+
from another_ayx_python_sdk.providers.amp_provider.builders.metadata_builder import (
|
22
|
+
MetadataBuilder,
|
23
|
+
)
|
24
|
+
from another_ayx_python_sdk.providers.amp_provider.resources.generated.incoming_connection_pb2 import (
|
25
|
+
IncomingConnection as ProtobufIncomingConnection,
|
26
|
+
)
|
27
|
+
|
28
|
+
|
29
|
+
if TYPE_CHECKING:
|
30
|
+
from another_ayx_python_sdk.providers import AMPInputAnchor
|
31
|
+
from another_ayx_python_sdk.core import InputConnectionBase
|
32
|
+
|
33
|
+
logger = logging.getLogger(__name__)
|
34
|
+
|
35
|
+
|
36
|
+
class InputConnectionBuilder:
|
37
|
+
"""RPC Builder for transforming InputConnection into Protobuf messages and vice versa."""
|
38
|
+
|
39
|
+
metadata_builder = MetadataBuilder()
|
40
|
+
|
41
|
+
@classmethod
|
42
|
+
def to_protobuf(
|
43
|
+
cls, amp_input_connection: "InputConnectionBase"
|
44
|
+
) -> ProtobufIncomingConnection:
|
45
|
+
"""
|
46
|
+
Serialize an AMPInputConnection object (amp_provider.amp_input_connection) into a Protobuf object.
|
47
|
+
|
48
|
+
Parameters
|
49
|
+
----------
|
50
|
+
amp_input_connection
|
51
|
+
An AMPInputConnection object to serialize into protobuf.
|
52
|
+
|
53
|
+
Returns
|
54
|
+
-------
|
55
|
+
ProtobufIncomingConnection
|
56
|
+
The Protobuf representation of the passed in AMPInputConnection.
|
57
|
+
"""
|
58
|
+
name = amp_input_connection.name
|
59
|
+
if amp_input_connection.metadata is None:
|
60
|
+
raise RuntimeError(
|
61
|
+
"Input connection must be open in order to convert it to a Protobuf message."
|
62
|
+
)
|
63
|
+
|
64
|
+
logger.debug("Serializing %s to protobuf", amp_input_connection.metadata)
|
65
|
+
metadata = cls.metadata_builder.to_protobuf(amp_input_connection.metadata)
|
66
|
+
return ProtobufIncomingConnection(name=name, metadata=metadata)
|
67
|
+
|
68
|
+
@classmethod
|
69
|
+
def from_protobuf(
|
70
|
+
cls,
|
71
|
+
protobuf_input_connection: ProtobufIncomingConnection,
|
72
|
+
amp_input_anchor: "AMPInputAnchor",
|
73
|
+
) -> AMPInputConnection:
|
74
|
+
"""
|
75
|
+
Deserialize a Protobuf object into an AMPInputConnection object (amp_provider.amp_input_connection).
|
76
|
+
|
77
|
+
Parameters
|
78
|
+
----------
|
79
|
+
protobuf_input_connection
|
80
|
+
Protobuf object to be serialized into an AMPInputAnchor.
|
81
|
+
amp_input_anchor
|
82
|
+
The AMPInputAnchor that the connection is associated with.
|
83
|
+
|
84
|
+
Returns
|
85
|
+
-------
|
86
|
+
AMPInputConnection
|
87
|
+
The AMPInputConnection representation of the protobuf object.
|
88
|
+
"""
|
89
|
+
name = protobuf_input_connection.name
|
90
|
+
logger.debug("Deserializing connection %s from protobuf", name)
|
91
|
+
metadata = cls.metadata_builder.from_protobuf(
|
92
|
+
protobuf_input_connection.metadata
|
93
|
+
)
|
94
|
+
logger.debug("Deserialized %s from protobuf", metadata)
|
95
|
+
return AMPInputConnection(name, metadata, amp_input_anchor)
|
@@ -0,0 +1,118 @@
|
|
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
|
+
"""Class that implements the serialization/deserialization for Metadata protobuf objects."""
|
15
|
+
import logging
|
16
|
+
|
17
|
+
from another_ayx_python_sdk.core.field import FieldType
|
18
|
+
from another_ayx_python_sdk.core.metadata import Metadata
|
19
|
+
from another_ayx_python_sdk.providers.amp_provider.resources.generated.metadata_pb2 import (
|
20
|
+
FieldType as ProtobufFieldType,
|
21
|
+
Metadata as ProtobufMetadata,
|
22
|
+
)
|
23
|
+
|
24
|
+
_protobuf_to_core_field_type = {
|
25
|
+
"FT_BOOL": FieldType.bool.value,
|
26
|
+
"FT_BYTE": FieldType.byte.value,
|
27
|
+
"FT_INT16": FieldType.int16.value,
|
28
|
+
"FT_INT32": FieldType.int32.value,
|
29
|
+
"FT_INT64": FieldType.int64.value,
|
30
|
+
"FT_FIXED_DECIMAL": FieldType.fixeddecimal.value,
|
31
|
+
"FT_FLOAT": FieldType.float.value,
|
32
|
+
"FT_DOUBLE": FieldType.double.value,
|
33
|
+
"FT_STRING": FieldType.string.value,
|
34
|
+
"FT_WSTRING": FieldType.wstring.value,
|
35
|
+
"FT_V_STRING": FieldType.v_string.value,
|
36
|
+
"FT_V_WSTRING": FieldType.v_wstring.value,
|
37
|
+
"FT_DATE": FieldType.date.value,
|
38
|
+
"FT_TIME": FieldType.time.value,
|
39
|
+
"FT_DATETIME": FieldType.datetime.value,
|
40
|
+
"FT_BLOB": FieldType.blob.value,
|
41
|
+
"FT_SPATIALOBJ": FieldType.spatialobj.value,
|
42
|
+
}
|
43
|
+
|
44
|
+
_core_to_protobuf_field_type = {
|
45
|
+
core_name: protobuf_name
|
46
|
+
for protobuf_name, core_name in _protobuf_to_core_field_type.items()
|
47
|
+
}
|
48
|
+
|
49
|
+
|
50
|
+
logger = logging.getLogger(__name__)
|
51
|
+
|
52
|
+
|
53
|
+
class MetadataBuilder:
|
54
|
+
"""RPC Builder for transforming Metadata into Protobufs and vice versa."""
|
55
|
+
|
56
|
+
@staticmethod
|
57
|
+
def to_protobuf(amp_metadata: Metadata) -> ProtobufMetadata:
|
58
|
+
"""
|
59
|
+
Serialize a Metadata (core.metadata) object into a protobuf.
|
60
|
+
|
61
|
+
Parameters
|
62
|
+
----------
|
63
|
+
amp_metadata
|
64
|
+
AMP Metadata object to be serialized into protobuf.
|
65
|
+
|
66
|
+
Returns
|
67
|
+
-------
|
68
|
+
ProtobufMetadata
|
69
|
+
The Protobuf representation of the AMP Metadata object.
|
70
|
+
"""
|
71
|
+
protobuf_metadata = ProtobufMetadata()
|
72
|
+
for field in amp_metadata.fields:
|
73
|
+
logger.debug("Serializing metadata field %s", field)
|
74
|
+
f = protobuf_metadata.fields.add()
|
75
|
+
f.name = field.name
|
76
|
+
f.size = field.size
|
77
|
+
f.scale = field.scale
|
78
|
+
f.source = field.source
|
79
|
+
f.description = field.description
|
80
|
+
f.type = ProtobufFieldType.Value(
|
81
|
+
_core_to_protobuf_field_type[field.type.value]
|
82
|
+
)
|
83
|
+
return protobuf_metadata
|
84
|
+
|
85
|
+
@staticmethod
|
86
|
+
def from_protobuf(protobuf_metadata: ProtobufMetadata) -> Metadata:
|
87
|
+
"""
|
88
|
+
Deserialize a protobuf into a Metadata object (core.metadata).
|
89
|
+
|
90
|
+
Parameters
|
91
|
+
----------
|
92
|
+
protobuf_metadata
|
93
|
+
Protobuf object to be serialized into an AMP metadata.
|
94
|
+
|
95
|
+
Returns
|
96
|
+
-------
|
97
|
+
Metadata
|
98
|
+
The AMP Metadata representation of the protobuf object.
|
99
|
+
"""
|
100
|
+
amp_metadata = Metadata()
|
101
|
+
for field in protobuf_metadata.fields:
|
102
|
+
name = field.name
|
103
|
+
field_type = FieldType(
|
104
|
+
_protobuf_to_core_field_type[ProtobufFieldType.Name(field.type)]
|
105
|
+
)
|
106
|
+
size = field.size or 0
|
107
|
+
scale = field.scale or 0
|
108
|
+
source = field.source or ""
|
109
|
+
description = field.description or ""
|
110
|
+
amp_metadata.add_field(
|
111
|
+
name=name,
|
112
|
+
field_type=field_type,
|
113
|
+
size=size,
|
114
|
+
scale=scale,
|
115
|
+
source=source,
|
116
|
+
description=description,
|
117
|
+
)
|
118
|
+
return amp_metadata
|
@@ -0,0 +1,110 @@
|
|
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
|
+
"""Builder file for Output Anchor."""
|
15
|
+
import logging
|
16
|
+
import sys
|
17
|
+
from typing import TYPE_CHECKING
|
18
|
+
|
19
|
+
from another_ayx_python_sdk.providers.amp_provider.builders.metadata_builder import (
|
20
|
+
MetadataBuilder,
|
21
|
+
)
|
22
|
+
from another_ayx_python_sdk.providers.amp_provider.resources.generated.outgoing_anchor_pb2 import (
|
23
|
+
OutgoingAnchor as ProtobufOutputAnchor,
|
24
|
+
)
|
25
|
+
|
26
|
+
if TYPE_CHECKING:
|
27
|
+
from another_ayx_python_sdk.providers import AMPOutputAnchor
|
28
|
+
|
29
|
+
|
30
|
+
logger = logging.getLogger(__name__)
|
31
|
+
|
32
|
+
|
33
|
+
class OutputAnchorBuilder:
|
34
|
+
"""Builder class for serializing and deserializing output anchors."""
|
35
|
+
|
36
|
+
@staticmethod
|
37
|
+
def from_protobuf(
|
38
|
+
protobuf_output_anchor: ProtobufOutputAnchor,
|
39
|
+
) -> "AMPOutputAnchor":
|
40
|
+
"""
|
41
|
+
Given an AMPOutputAnchor as a protobuf, return its Python object.
|
42
|
+
|
43
|
+
Parameters
|
44
|
+
----------
|
45
|
+
protobuf_output_anchor
|
46
|
+
Protobuf object to be serialized into an AMP metadata.
|
47
|
+
|
48
|
+
Returns
|
49
|
+
-------
|
50
|
+
AMPOutputAnchor
|
51
|
+
The AMP Metadata representation of the protobuf object.
|
52
|
+
"""
|
53
|
+
from another_ayx_python_sdk.providers.amp_provider.amp_output_anchor import (
|
54
|
+
AMPOutputAnchor,
|
55
|
+
)
|
56
|
+
|
57
|
+
logger.debug(
|
58
|
+
"Deserializing Output Anchor %s from protobuf", protobuf_output_anchor.name
|
59
|
+
)
|
60
|
+
core_output_anchor = AMPOutputAnchor(
|
61
|
+
protobuf_output_anchor.name,
|
62
|
+
num_connections=protobuf_output_anchor.num_connections or 0,
|
63
|
+
)
|
64
|
+
|
65
|
+
if (
|
66
|
+
protobuf_output_anchor.options
|
67
|
+
!= ProtobufOutputAnchor.OutgoingAnchorOptions.ORDERED
|
68
|
+
):
|
69
|
+
raise ValueError("Only ordered output anchors are supported.")
|
70
|
+
logger.debug("Deserialized Output Anchor %s from protobuf", core_output_anchor)
|
71
|
+
return core_output_anchor
|
72
|
+
|
73
|
+
@staticmethod
|
74
|
+
def to_protobuf(
|
75
|
+
output_anchor: "AMPOutputAnchor",
|
76
|
+
anchor_options: ProtobufOutputAnchor.OutgoingAnchorOptions = ProtobufOutputAnchor.OutgoingAnchorOptions.ORDERED,
|
77
|
+
record_limit: int = sys.maxsize,
|
78
|
+
) -> ProtobufOutputAnchor:
|
79
|
+
"""
|
80
|
+
Given an AMPOutputAnchor, return a protobuf representation.
|
81
|
+
|
82
|
+
Parameters
|
83
|
+
----------
|
84
|
+
output_anchor
|
85
|
+
AMP Output Anchor object to be serialized into protobuf.
|
86
|
+
anchor_options
|
87
|
+
Anchor must receive packets in the order that they came in.
|
88
|
+
record_limit
|
89
|
+
Max number of records the anchor can receive.
|
90
|
+
|
91
|
+
Returns
|
92
|
+
-------
|
93
|
+
ProtobufMetadata
|
94
|
+
The Protobuf representation of the AMP Metadata object.
|
95
|
+
"""
|
96
|
+
metadata = (
|
97
|
+
MetadataBuilder.to_protobuf(output_anchor.metadata)
|
98
|
+
if output_anchor.is_open
|
99
|
+
else None
|
100
|
+
)
|
101
|
+
logger.debug("Serialized metadata %s to protobuf", metadata)
|
102
|
+
protobuf_output_anchor = ProtobufOutputAnchor(
|
103
|
+
name=output_anchor.name,
|
104
|
+
num_connections=output_anchor.num_connections,
|
105
|
+
metadata=metadata,
|
106
|
+
options=anchor_options,
|
107
|
+
record_limit=record_limit,
|
108
|
+
)
|
109
|
+
logger.debug("Serialized Ouptut Anchor %s to protobuf", output_anchor.name)
|
110
|
+
return protobuf_output_anchor
|