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,252 @@
|
|
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 saves/retrieves input record packets."""
|
15
|
+
import logging
|
16
|
+
from typing import Dict, List, TYPE_CHECKING, Tuple
|
17
|
+
|
18
|
+
from another_ayx_python_sdk.core.input_connection_base import InputConnectionStatus
|
19
|
+
from another_ayx_python_sdk.providers.amp_provider.amp_record_packet import AMPRecordPacket
|
20
|
+
from another_ayx_python_sdk.providers.amp_provider.builders.record_packet_builder import (
|
21
|
+
RecordPacketBuilder,
|
22
|
+
)
|
23
|
+
from another_ayx_python_sdk.providers.amp_provider.repositories.input_connection_repository import (
|
24
|
+
InputConnectionRepository,
|
25
|
+
)
|
26
|
+
from another_ayx_python_sdk.providers.amp_provider.repositories.input_metadata_repository import (
|
27
|
+
InputMetadataRepository,
|
28
|
+
)
|
29
|
+
from another_ayx_python_sdk.providers.amp_provider.repositories.singleton import Singleton
|
30
|
+
|
31
|
+
|
32
|
+
if TYPE_CHECKING:
|
33
|
+
from another_ayx_python_sdk.core.metadata import Metadata
|
34
|
+
from another_ayx_python_sdk.core.record_packet_base import RecordPacketBase
|
35
|
+
from another_ayx_python_sdk.providers.amp_provider.resources.generated.record_packet_pb2 import (
|
36
|
+
RecordPacket as ProtobufRecordPacket,
|
37
|
+
)
|
38
|
+
|
39
|
+
import pandas as pd # noqa: F401
|
40
|
+
|
41
|
+
logger = logging.getLogger(__name__)
|
42
|
+
|
43
|
+
|
44
|
+
class UnfinishedRecordPacketException(Exception):
|
45
|
+
"""Exception to be raised to indicate that a record packet isn't ready to be returned."""
|
46
|
+
|
47
|
+
pass
|
48
|
+
|
49
|
+
|
50
|
+
class EmptyRecordPacketRepositoryException(Exception):
|
51
|
+
"""Exception to be raised after the final record packet has been returned."""
|
52
|
+
|
53
|
+
pass
|
54
|
+
|
55
|
+
|
56
|
+
class InputRecordPacketRepository(metaclass=Singleton):
|
57
|
+
"""Repository that stores input record packets."""
|
58
|
+
|
59
|
+
_record_packet_builder = RecordPacketBuilder()
|
60
|
+
_input_connection_repo = InputConnectionRepository()
|
61
|
+
|
62
|
+
def __init__(self) -> None:
|
63
|
+
"""Initialize the input record packet repository."""
|
64
|
+
self._record_packet_cache: Dict[
|
65
|
+
str, Dict[str, Tuple["pd.DataFrame", "pd.DataFrame", int]]
|
66
|
+
] = {}
|
67
|
+
self._records_list: Dict[str, Dict[str, List["pd.DataFrame"]]] = {}
|
68
|
+
|
69
|
+
def push_record_packet(
|
70
|
+
self, anchor_name: str, connection_name: str, record_packet: "RecordPacketBase"
|
71
|
+
) -> None:
|
72
|
+
"""Save a record packet."""
|
73
|
+
logger.debug(
|
74
|
+
"Saving record packet (%r) for anchor %s on connection %s",
|
75
|
+
record_packet,
|
76
|
+
anchor_name,
|
77
|
+
connection_name,
|
78
|
+
)
|
79
|
+
self._records_list.setdefault(anchor_name, {})
|
80
|
+
self._records_list[anchor_name].setdefault(connection_name, [])
|
81
|
+
|
82
|
+
self._record_packet_cache.setdefault(anchor_name, {})
|
83
|
+
|
84
|
+
self._records_list[anchor_name][connection_name].append(
|
85
|
+
record_packet.to_dataframe()
|
86
|
+
)
|
87
|
+
|
88
|
+
def save_grpc_record_packet(
|
89
|
+
self,
|
90
|
+
anchor_name: str,
|
91
|
+
connection_name: str,
|
92
|
+
grpc_record_packet: "ProtobufRecordPacket",
|
93
|
+
metadata: "Metadata",
|
94
|
+
) -> None:
|
95
|
+
"""Save a record packet from its protobuffer format."""
|
96
|
+
record_packet, _, _ = self._record_packet_builder.from_protobuf(
|
97
|
+
grpc_record_packet, metadata
|
98
|
+
)
|
99
|
+
self.push_record_packet(anchor_name, connection_name, record_packet)
|
100
|
+
|
101
|
+
def _reshape_packets(
|
102
|
+
self, anchor_name: str, connection_name: str
|
103
|
+
) -> Tuple["pd.DataFrame", "pd.DataFrame", int]:
|
104
|
+
"""
|
105
|
+
Reshape packets based on number of requested rows.
|
106
|
+
|
107
|
+
Concatenate record packets from the queue into a single dataframe,
|
108
|
+
then return that dataframe and the number of record packets to remove from the queue.
|
109
|
+
|
110
|
+
Parameters
|
111
|
+
----------
|
112
|
+
anchor_name
|
113
|
+
The name of the input anchor that the metadata is associated with.
|
114
|
+
connection_name
|
115
|
+
The name of the input connection that the metadata is associated with.
|
116
|
+
|
117
|
+
Returns
|
118
|
+
-------
|
119
|
+
Tuple["pd.DataFrame", "pd.DataFrame", int]
|
120
|
+
A tuple containing:
|
121
|
+
Dataframe containing the correct number of packets,
|
122
|
+
the remainder of the original dataframe, and
|
123
|
+
number of packets to remove from internal queue
|
124
|
+
"""
|
125
|
+
import numpy as np # noqa: F811
|
126
|
+
import pandas as pd # noqa: F811
|
127
|
+
|
128
|
+
if anchor_name not in self._records_list:
|
129
|
+
raise ValueError(f"Anchor {anchor_name} not found in repository.")
|
130
|
+
|
131
|
+
if connection_name not in self._records_list[anchor_name]:
|
132
|
+
raise ValueError(
|
133
|
+
f"Connection {connection_name} not found in repository for anchor {anchor_name}."
|
134
|
+
)
|
135
|
+
|
136
|
+
if connection_name in self._record_packet_cache[anchor_name]:
|
137
|
+
return self._record_packet_cache[anchor_name][connection_name]
|
138
|
+
|
139
|
+
max_packet_size = self._input_connection_repo.get_connection(
|
140
|
+
anchor_name, connection_name
|
141
|
+
).max_packet_size
|
142
|
+
|
143
|
+
if len(self._records_list[anchor_name][connection_name]) == 0:
|
144
|
+
raise EmptyRecordPacketRepositoryException
|
145
|
+
|
146
|
+
if max_packet_size is None:
|
147
|
+
self._record_packet_cache[anchor_name][connection_name] = (
|
148
|
+
pd.concat(self._records_list[anchor_name][connection_name]),
|
149
|
+
pd.DataFrame(),
|
150
|
+
len(self._records_list[anchor_name][connection_name]),
|
151
|
+
)
|
152
|
+
return self._record_packet_cache[anchor_name][connection_name]
|
153
|
+
|
154
|
+
cumulative_lengths: np.ndarray = np.cumsum(
|
155
|
+
[len(packet) for packet in self._records_list[anchor_name][connection_name]]
|
156
|
+
)
|
157
|
+
if (
|
158
|
+
cumulative_lengths[-1] < max_packet_size
|
159
|
+
and not InputConnectionRepository().get_connection_status(
|
160
|
+
anchor_name, connection_name
|
161
|
+
)
|
162
|
+
== InputConnectionStatus.CLOSED
|
163
|
+
):
|
164
|
+
raise UnfinishedRecordPacketException
|
165
|
+
|
166
|
+
packets = [
|
167
|
+
idx
|
168
|
+
for idx, element in enumerate(cumulative_lengths)
|
169
|
+
if element > max_packet_size and idx > 0
|
170
|
+
] + [len(cumulative_lengths)]
|
171
|
+
num_packets_to_merge = packets[0]
|
172
|
+
|
173
|
+
df = pd.concat(
|
174
|
+
self._records_list[anchor_name][connection_name][:num_packets_to_merge]
|
175
|
+
)
|
176
|
+
right_size_dataframe = df.iloc[:max_packet_size]
|
177
|
+
overflow_dataframe = df.iloc[max_packet_size:]
|
178
|
+
self._record_packet_cache[anchor_name][connection_name] = (
|
179
|
+
right_size_dataframe,
|
180
|
+
overflow_dataframe,
|
181
|
+
num_packets_to_merge,
|
182
|
+
)
|
183
|
+
return self._record_packet_cache[anchor_name][connection_name]
|
184
|
+
|
185
|
+
def peek_record_packet(
|
186
|
+
self, anchor_name: str, connection_name: str
|
187
|
+
) -> "RecordPacketBase":
|
188
|
+
"""
|
189
|
+
Get the next record packet without popping from the queue.
|
190
|
+
|
191
|
+
Parameters
|
192
|
+
----------
|
193
|
+
anchor_name
|
194
|
+
The name of the input anchor that the metadata is associated with.
|
195
|
+
connection_name
|
196
|
+
The name of the input connection that the metadata is associated with.
|
197
|
+
|
198
|
+
Returns
|
199
|
+
-------
|
200
|
+
RecordPacketBase
|
201
|
+
The AMPRecordPacket at the front of the internal queue.
|
202
|
+
"""
|
203
|
+
self._record_packet_cache.setdefault(anchor_name, {})
|
204
|
+
right_size_dataframe, _, _ = self._reshape_packets(anchor_name, connection_name)
|
205
|
+
return AMPRecordPacket(
|
206
|
+
InputMetadataRepository().get_metadata(anchor_name, connection_name),
|
207
|
+
right_size_dataframe,
|
208
|
+
)
|
209
|
+
|
210
|
+
def pop_record_packet(
|
211
|
+
self, anchor_name: str, connection_name: str
|
212
|
+
) -> "RecordPacketBase":
|
213
|
+
"""
|
214
|
+
Retrieve record packet if there are enough records to meet the max packet size criteria.
|
215
|
+
|
216
|
+
Parameters
|
217
|
+
----------
|
218
|
+
anchor_name
|
219
|
+
The name of the input anchor that the metadata is associated with.
|
220
|
+
connection_name
|
221
|
+
The name of the input connection that the metadata is associated with.
|
222
|
+
|
223
|
+
Returns
|
224
|
+
-------
|
225
|
+
RecordPacketBase
|
226
|
+
The AMPRecordPacket that was popped off the internal queue.
|
227
|
+
"""
|
228
|
+
(
|
229
|
+
right_size_dataframe,
|
230
|
+
remainder_packet,
|
231
|
+
packets_to_remove,
|
232
|
+
) = self._reshape_packets(anchor_name, connection_name)
|
233
|
+
|
234
|
+
self._records_list[anchor_name][connection_name] = self._records_list[
|
235
|
+
anchor_name
|
236
|
+
][connection_name][packets_to_remove:]
|
237
|
+
if connection_name in self._record_packet_cache[anchor_name]:
|
238
|
+
del self._record_packet_cache[anchor_name][connection_name]
|
239
|
+
|
240
|
+
if not remainder_packet.empty:
|
241
|
+
self._records_list[anchor_name][connection_name].insert(0, remainder_packet)
|
242
|
+
|
243
|
+
return AMPRecordPacket(
|
244
|
+
InputMetadataRepository().get_metadata(anchor_name, connection_name),
|
245
|
+
right_size_dataframe,
|
246
|
+
)
|
247
|
+
|
248
|
+
def clear_repository(self) -> None:
|
249
|
+
"""Delete all data in the repository."""
|
250
|
+
logger.debug("Clearing InputRecordPacketRepository")
|
251
|
+
self._records_list = {}
|
252
|
+
self._record_packet_cache = {}
|
build/lib/build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/io_repository.py
ADDED
@@ -0,0 +1,188 @@
|
|
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 saves and retrieves AMP IO information."""
|
15
|
+
import logging
|
16
|
+
import uuid
|
17
|
+
from pathlib import Path
|
18
|
+
from typing import Any, cast
|
19
|
+
|
20
|
+
from another_ayx_python_sdk.core.exceptions import WorkflowRuntimeError
|
21
|
+
from another_ayx_python_sdk.providers.amp_provider.repositories import EnvironmentRepository
|
22
|
+
from another_ayx_python_sdk.providers.amp_provider.repositories import GrpcRepository
|
23
|
+
from another_ayx_python_sdk.providers.amp_provider.repositories.singleton import Singleton
|
24
|
+
from another_ayx_python_sdk.providers.amp_provider.resources.generated.output_message_data_pb2 import (
|
25
|
+
OutputMessageData,
|
26
|
+
OutputMessageTypes,
|
27
|
+
)
|
28
|
+
from another_ayx_python_sdk.providers.amp_provider.resources.generated.password_data_pb2 import (
|
29
|
+
PasswordData,
|
30
|
+
)
|
31
|
+
from another_ayx_python_sdk.providers.amp_provider.resources.generated.translate_message_data_pb2 import (
|
32
|
+
TranslateMessageData,
|
33
|
+
)
|
34
|
+
|
35
|
+
logger = logging.getLogger(__name__)
|
36
|
+
|
37
|
+
|
38
|
+
class IORepository(metaclass=Singleton):
|
39
|
+
"""Repository that stores IO information."""
|
40
|
+
|
41
|
+
def __init__(self) -> None:
|
42
|
+
"""Initialize the IO repository."""
|
43
|
+
|
44
|
+
@staticmethod
|
45
|
+
def save_error(error_msg: str) -> None:
|
46
|
+
"""
|
47
|
+
Display an error message in the Results window.
|
48
|
+
|
49
|
+
Parameters
|
50
|
+
----------
|
51
|
+
error_msg
|
52
|
+
The error message to be output.
|
53
|
+
"""
|
54
|
+
GrpcRepository().get_sdk_engine_client().OutputMessage(
|
55
|
+
OutputMessageData(
|
56
|
+
message_type=OutputMessageTypes.OMT_Error, message=error_msg
|
57
|
+
)
|
58
|
+
)
|
59
|
+
|
60
|
+
@staticmethod
|
61
|
+
def save_warn(warn_msg: str) -> None:
|
62
|
+
"""
|
63
|
+
Display a warning message in the Results window.
|
64
|
+
|
65
|
+
Parameters
|
66
|
+
----------
|
67
|
+
warn_msg
|
68
|
+
The warning message to be output.
|
69
|
+
"""
|
70
|
+
GrpcRepository().get_sdk_engine_client().OutputMessage(
|
71
|
+
OutputMessageData(
|
72
|
+
message_type=OutputMessageTypes.OMT_Warning, message=warn_msg
|
73
|
+
)
|
74
|
+
)
|
75
|
+
|
76
|
+
@staticmethod
|
77
|
+
def save_info(info_msg: str) -> None:
|
78
|
+
"""
|
79
|
+
Display an info message in the Results window.
|
80
|
+
|
81
|
+
Parameters
|
82
|
+
----------
|
83
|
+
info_msg
|
84
|
+
The info message to be output.
|
85
|
+
"""
|
86
|
+
GrpcRepository().get_sdk_engine_client().OutputMessage(
|
87
|
+
OutputMessageData(
|
88
|
+
message_type=OutputMessageTypes.OMT_Info, message=info_msg
|
89
|
+
)
|
90
|
+
)
|
91
|
+
|
92
|
+
@staticmethod
|
93
|
+
def get_translate_msg(msg: str, *args: Any) -> str:
|
94
|
+
"""
|
95
|
+
Translate a message to the current locale.
|
96
|
+
|
97
|
+
Parameters
|
98
|
+
----------
|
99
|
+
msg
|
100
|
+
Message to translate.
|
101
|
+
*args
|
102
|
+
Interpolation data for the string.
|
103
|
+
|
104
|
+
Returns
|
105
|
+
-------
|
106
|
+
str
|
107
|
+
The message, translated into the locale.
|
108
|
+
"""
|
109
|
+
interpolation_data = [str(arg) for arg in args] if len(args) > 0 else []
|
110
|
+
res = (
|
111
|
+
GrpcRepository()
|
112
|
+
.get_sdk_engine_client()
|
113
|
+
.TranslateMessage(
|
114
|
+
TranslateMessageData(
|
115
|
+
unlocalized_string=msg, interpolation_data=interpolation_data
|
116
|
+
)
|
117
|
+
)
|
118
|
+
)
|
119
|
+
|
120
|
+
return cast(str, res.translated_message)
|
121
|
+
|
122
|
+
@staticmethod
|
123
|
+
def update_progress(percent: float) -> None:
|
124
|
+
"""
|
125
|
+
Update tool progress.
|
126
|
+
|
127
|
+
Parameters
|
128
|
+
----------
|
129
|
+
percent
|
130
|
+
The progress (how close the connection is to processing all records) as a percentage.
|
131
|
+
"""
|
132
|
+
# TODO
|
133
|
+
|
134
|
+
@staticmethod
|
135
|
+
def get_temp_file(extension: str = "tmp") -> "Path":
|
136
|
+
"""
|
137
|
+
Create a temporary file managed by Designer.
|
138
|
+
|
139
|
+
Parameters
|
140
|
+
----------
|
141
|
+
extension
|
142
|
+
The file extension of the temp file.
|
143
|
+
|
144
|
+
Returns
|
145
|
+
-------
|
146
|
+
Path
|
147
|
+
The path to where the temp file is.
|
148
|
+
"""
|
149
|
+
temp_file_name = f"temp-file-{str(uuid.uuid4())}.{str(extension)}"
|
150
|
+
engine_temp_dir = EnvironmentRepository().get_temp_dir()
|
151
|
+
temp_file_path = Path(engine_temp_dir) / (temp_file_name)
|
152
|
+
try:
|
153
|
+
temp_file_path.touch()
|
154
|
+
except FileNotFoundError:
|
155
|
+
# path does not exist
|
156
|
+
logger.error("Engine.TempFilePath (%s) does not exist", engine_temp_dir)
|
157
|
+
except IOError:
|
158
|
+
# path exists but no write permissions
|
159
|
+
logger.error("No write permissions for directory %s", engine_temp_dir)
|
160
|
+
|
161
|
+
return Path(temp_file_path)
|
162
|
+
|
163
|
+
@staticmethod
|
164
|
+
def decrypt_password(password: str) -> str: # noqa: D102
|
165
|
+
"""
|
166
|
+
Decrypt password.
|
167
|
+
|
168
|
+
Parameters
|
169
|
+
----------
|
170
|
+
password
|
171
|
+
The password to decrypt.
|
172
|
+
|
173
|
+
Returns
|
174
|
+
-------
|
175
|
+
str
|
176
|
+
The decrypted password.
|
177
|
+
"""
|
178
|
+
import grpc
|
179
|
+
|
180
|
+
try:
|
181
|
+
decrypted = (
|
182
|
+
GrpcRepository()
|
183
|
+
.get_sdk_engine_client()
|
184
|
+
.DecryptPassword(PasswordData(password=password))
|
185
|
+
)
|
186
|
+
except grpc.RpcError:
|
187
|
+
raise WorkflowRuntimeError("Error decrypting password")
|
188
|
+
return cast(str, decrypted.password)
|
@@ -0,0 +1,117 @@
|
|
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
|
+
"""Repository for output anchor GRPC."""
|
15
|
+
import logging
|
16
|
+
from typing import Dict, List, TYPE_CHECKING
|
17
|
+
|
18
|
+
from another_ayx_python_sdk.providers.amp_provider.builders.output_anchor_builder import (
|
19
|
+
OutputAnchorBuilder,
|
20
|
+
)
|
21
|
+
from another_ayx_python_sdk.providers.amp_provider.repositories.singleton import Singleton
|
22
|
+
|
23
|
+
|
24
|
+
if TYPE_CHECKING:
|
25
|
+
from another_ayx_python_sdk.providers.amp_provider.amp_output_anchor import (
|
26
|
+
AMPOutputAnchor as CoreOutputAnchor,
|
27
|
+
)
|
28
|
+
from another_ayx_python_sdk.providers.amp_provider.resources.generated.outgoing_anchor_pb2 import (
|
29
|
+
OutgoingAnchor as GrpcOutputAnchor,
|
30
|
+
)
|
31
|
+
|
32
|
+
|
33
|
+
logger = logging.getLogger(__name__)
|
34
|
+
|
35
|
+
|
36
|
+
class OutputAnchorRepository(metaclass=Singleton):
|
37
|
+
"""Repository class, output anchors."""
|
38
|
+
|
39
|
+
_output_anchor_builder = OutputAnchorBuilder()
|
40
|
+
|
41
|
+
def __init__(self) -> None:
|
42
|
+
self._repository: Dict[str, "CoreOutputAnchor"] = {}
|
43
|
+
|
44
|
+
def save_anchor(self, anchor: "CoreOutputAnchor") -> None:
|
45
|
+
"""
|
46
|
+
Save an AMPOutputAnchor object to the repository.
|
47
|
+
|
48
|
+
Parameters
|
49
|
+
----------
|
50
|
+
anchor
|
51
|
+
The AMP output anchor to save to the repository.
|
52
|
+
"""
|
53
|
+
logger.debug("Adding anchor %s to OutputAnchorRepository", anchor.name)
|
54
|
+
self._repository[anchor.name] = anchor
|
55
|
+
logger.debug("Current OutputAnchorRepository State: %s", self._repository)
|
56
|
+
|
57
|
+
def get_anchor(self, anchor_name: str) -> "CoreOutputAnchor":
|
58
|
+
"""
|
59
|
+
Retrieve an AMPOutputAnchor object from the repository if it's already been saved.
|
60
|
+
|
61
|
+
Parameters
|
62
|
+
----------
|
63
|
+
anchor_name
|
64
|
+
The name of the output anchor to get from the repository.
|
65
|
+
|
66
|
+
Returns
|
67
|
+
-------
|
68
|
+
CoreOutputAnchor
|
69
|
+
The retrieved output anchor that corresponds to the anchor name.
|
70
|
+
"""
|
71
|
+
if anchor_name not in self._repository:
|
72
|
+
raise ValueError(f"Anchor {anchor_name} does not exist")
|
73
|
+
return self._repository[anchor_name]
|
74
|
+
|
75
|
+
def delete_anchor(self, anchor_name: str) -> None:
|
76
|
+
"""
|
77
|
+
Remove an AMPOutputAnchor object from the repository if it's already been saved.
|
78
|
+
|
79
|
+
Parameters
|
80
|
+
----------
|
81
|
+
anchor_name
|
82
|
+
The name of the output anchor to delete from the repository.
|
83
|
+
"""
|
84
|
+
if anchor_name not in self._repository:
|
85
|
+
raise ValueError(f"Anchor {anchor_name} can't be deleted, it doesn't exist")
|
86
|
+
logger.debug("Removing anchor %s from OutputAnchorRepository", anchor_name)
|
87
|
+
del self._repository[anchor_name]
|
88
|
+
logger.debug("Current OutputAnchorRepository State: %s", self._repository)
|
89
|
+
|
90
|
+
def save_grpc_anchor(self, anchor: "GrpcOutputAnchor") -> None:
|
91
|
+
"""
|
92
|
+
Save a protobuf Output Anchor to the repository.
|
93
|
+
|
94
|
+
Parameters
|
95
|
+
----------
|
96
|
+
anchor
|
97
|
+
The grpc representation of the output anchor.
|
98
|
+
"""
|
99
|
+
core_anchor = self._output_anchor_builder.from_protobuf(anchor)
|
100
|
+
self.save_anchor(anchor=core_anchor)
|
101
|
+
|
102
|
+
def clear_repository(self) -> None:
|
103
|
+
"""Delete all data in the repository."""
|
104
|
+
logger.debug("Clearing OutputAnchorRepository")
|
105
|
+
self._repository = {}
|
106
|
+
logger.debug("Current OutputAnchorRepository State: %s", self._repository)
|
107
|
+
|
108
|
+
def get_all_anchor_names(self) -> List[str]:
|
109
|
+
"""
|
110
|
+
Pull a list of all anchor names in the repository.
|
111
|
+
|
112
|
+
Returns
|
113
|
+
-------
|
114
|
+
List[str]
|
115
|
+
List of all anchor names that exist in the repository.
|
116
|
+
"""
|
117
|
+
return list(self._repository.keys())
|
@@ -0,0 +1,129 @@
|
|
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 saves output metadata information given the associated anchor name."""
|
15
|
+
import logging
|
16
|
+
from typing import Dict, TYPE_CHECKING
|
17
|
+
|
18
|
+
from another_ayx_python_sdk.providers.amp_provider.builders.metadata_builder import (
|
19
|
+
MetadataBuilder,
|
20
|
+
)
|
21
|
+
from another_ayx_python_sdk.providers.amp_provider.repositories import GrpcRepository
|
22
|
+
from another_ayx_python_sdk.providers.amp_provider.repositories.singleton import Singleton
|
23
|
+
from another_ayx_python_sdk.providers.amp_provider.resources.generated.outgoing_metadata_push_pb2 import (
|
24
|
+
OutgoingMetadataPush,
|
25
|
+
)
|
26
|
+
|
27
|
+
if TYPE_CHECKING:
|
28
|
+
from another_ayx_python_sdk.core.metadata import Metadata as CoreMetadata
|
29
|
+
from another_ayx_python_sdk.providers.amp_provider.resources.generated.metadata_pb2 import (
|
30
|
+
Metadata as ProtobufMetadata,
|
31
|
+
)
|
32
|
+
|
33
|
+
|
34
|
+
logger = logging.getLogger(__name__)
|
35
|
+
|
36
|
+
|
37
|
+
class OutputMetadataRepository(metaclass=Singleton):
|
38
|
+
"""Repository that stores output metadata information."""
|
39
|
+
|
40
|
+
_metadata_builder = MetadataBuilder()
|
41
|
+
|
42
|
+
def __init__(self) -> None:
|
43
|
+
"""Initialize the output metadata repository."""
|
44
|
+
self._metadata_map: Dict[str, "CoreMetadata"] = {}
|
45
|
+
|
46
|
+
def save_metadata(self, anchor_name: str, metadata: "CoreMetadata") -> None:
|
47
|
+
"""
|
48
|
+
Save output metadata information for the associated anchor name.
|
49
|
+
|
50
|
+
Parameters
|
51
|
+
----------
|
52
|
+
anchor_name
|
53
|
+
The name of the anchor.
|
54
|
+
metadata
|
55
|
+
The metadata of the record packets that will be associated with this anchor.
|
56
|
+
"""
|
57
|
+
logger.debug("Saving metadata %s to anchor %s", metadata, anchor_name)
|
58
|
+
self._metadata_map[anchor_name] = metadata
|
59
|
+
logger.debug("Current OutputMetadataRepository State: %s", self._metadata_map)
|
60
|
+
|
61
|
+
try:
|
62
|
+
client = GrpcRepository().get_sdk_engine_client()
|
63
|
+
except ValueError:
|
64
|
+
pass
|
65
|
+
else:
|
66
|
+
client.PushOutgoingMetadata(
|
67
|
+
OutgoingMetadataPush(
|
68
|
+
output_anchor_name=anchor_name,
|
69
|
+
metadata=self.get_grpc_metadata(anchor_name),
|
70
|
+
)
|
71
|
+
)
|
72
|
+
|
73
|
+
def get_metadata(self, anchor_name: str) -> "CoreMetadata":
|
74
|
+
"""
|
75
|
+
Get the output metadata associated with the given anchor name.
|
76
|
+
|
77
|
+
Parameters
|
78
|
+
----------
|
79
|
+
anchor_name
|
80
|
+
The name of the anchor.
|
81
|
+
|
82
|
+
Returns
|
83
|
+
-------
|
84
|
+
CoreMetadata
|
85
|
+
Retrieves the metadata that is associatd with the specified anchor.
|
86
|
+
"""
|
87
|
+
if anchor_name not in self._metadata_map:
|
88
|
+
raise ValueError(f"Anchor {anchor_name} not found in repository.")
|
89
|
+
|
90
|
+
return self._metadata_map[anchor_name]
|
91
|
+
|
92
|
+
def get_grpc_metadata(self, anchor_name: str) -> "ProtobufMetadata":
|
93
|
+
"""
|
94
|
+
Get the output Protobuf metadata message associated with the given anchor name.
|
95
|
+
|
96
|
+
Parameters
|
97
|
+
----------
|
98
|
+
anchor_name
|
99
|
+
The name of the anchor.
|
100
|
+
|
101
|
+
Returns
|
102
|
+
-------
|
103
|
+
ProtobufMetadata
|
104
|
+
The metadata of the record packets that will be associated with this anchor as a protobuf object.
|
105
|
+
"""
|
106
|
+
metadata = self.get_metadata(anchor_name)
|
107
|
+
|
108
|
+
return self._metadata_builder.to_protobuf(metadata)
|
109
|
+
|
110
|
+
def delete_metadata(self, anchor_name: str) -> None:
|
111
|
+
"""
|
112
|
+
Delete the output metadata associated with the given anchor name.
|
113
|
+
|
114
|
+
Parameters
|
115
|
+
----------
|
116
|
+
anchor_name
|
117
|
+
The name of the anchor to delete.
|
118
|
+
"""
|
119
|
+
if anchor_name not in self._metadata_map:
|
120
|
+
raise ValueError(f"Anchor {anchor_name} not found in repository.")
|
121
|
+
logger.debug("Removing metadata associated with anchor %s", anchor_name)
|
122
|
+
self._metadata_map.pop(anchor_name)
|
123
|
+
logger.debug("Current OutputAnchorRepository State: %s", self._metadata_map)
|
124
|
+
|
125
|
+
def clear_repository(self) -> None:
|
126
|
+
"""Delete all data in the repository."""
|
127
|
+
logger.debug("Clearing OutputAnchorRepository")
|
128
|
+
self._metadata_map = {}
|
129
|
+
logger.debug("Current OutputAnchorRepository State: %s", self._metadata_map)
|