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,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
|
+
"""Record Packet Base class definition."""
|
15
|
+
import hashlib
|
16
|
+
from abc import ABC, abstractmethod
|
17
|
+
from typing import Any, TYPE_CHECKING
|
18
|
+
|
19
|
+
|
20
|
+
if TYPE_CHECKING:
|
21
|
+
from another_ayx_python_sdk.core.metadata import Metadata
|
22
|
+
import pandas as pd
|
23
|
+
|
24
|
+
|
25
|
+
class RecordPacketBase(ABC):
|
26
|
+
"""Abstract class that describes a record packet."""
|
27
|
+
|
28
|
+
@property
|
29
|
+
@abstractmethod
|
30
|
+
def metadata(self) -> "Metadata":
|
31
|
+
"""
|
32
|
+
Get the packet metadata.
|
33
|
+
|
34
|
+
Returns
|
35
|
+
-------
|
36
|
+
Metadata
|
37
|
+
The metadata for records contained in the packet.
|
38
|
+
"""
|
39
|
+
raise NotImplementedError()
|
40
|
+
|
41
|
+
@abstractmethod
|
42
|
+
def to_dataframe(self) -> "pd.DataFrame":
|
43
|
+
"""
|
44
|
+
Get the packet data as a dataframe.
|
45
|
+
|
46
|
+
Returns
|
47
|
+
-------
|
48
|
+
pd.DataFrame
|
49
|
+
The dataframe that contains all records in the packet.
|
50
|
+
"""
|
51
|
+
raise NotImplementedError()
|
52
|
+
|
53
|
+
@classmethod
|
54
|
+
@abstractmethod
|
55
|
+
def from_dataframe(
|
56
|
+
cls, metadata: "Metadata", df: "pd.DataFrame"
|
57
|
+
) -> "RecordPacketBase":
|
58
|
+
"""
|
59
|
+
Set the packet data from a dataframe.
|
60
|
+
|
61
|
+
Parameters
|
62
|
+
----------
|
63
|
+
metadata
|
64
|
+
The metadata for the records.
|
65
|
+
df
|
66
|
+
The dataframe to generate records from.
|
67
|
+
"""
|
68
|
+
raise NotImplementedError()
|
69
|
+
|
70
|
+
def __eq__(self, other: Any) -> bool:
|
71
|
+
"""
|
72
|
+
Check equality between 2 packets.
|
73
|
+
|
74
|
+
Parameters
|
75
|
+
----------
|
76
|
+
other
|
77
|
+
Other object to compare with this object.
|
78
|
+
|
79
|
+
Returns
|
80
|
+
-------
|
81
|
+
bool
|
82
|
+
True if metadata and all dataframes of this record packet have the same values as the other record packet.
|
83
|
+
"""
|
84
|
+
if not isinstance(other, RecordPacketBase):
|
85
|
+
return NotImplemented
|
86
|
+
|
87
|
+
if self.metadata != other.metadata:
|
88
|
+
return False
|
89
|
+
|
90
|
+
import pandas as pd
|
91
|
+
|
92
|
+
try:
|
93
|
+
pd.testing.assert_frame_equal(self.to_dataframe(), other.to_dataframe())
|
94
|
+
except AssertionError:
|
95
|
+
return False
|
96
|
+
else:
|
97
|
+
return True
|
98
|
+
|
99
|
+
def to_readable_string(self) -> str:
|
100
|
+
"""
|
101
|
+
Return the string representation of a record packet, with a human-readable pandas dataframe.
|
102
|
+
|
103
|
+
Returns
|
104
|
+
-------
|
105
|
+
str
|
106
|
+
Human-readable form of the record packet.
|
107
|
+
"""
|
108
|
+
return f"Metadata: {self.metadata}\nDataframe: {self.to_dataframe()}"
|
109
|
+
|
110
|
+
def to_anonymized_string(self) -> str:
|
111
|
+
"""
|
112
|
+
Return the string representation of a record packet, anonymizing the data within before conversion.
|
113
|
+
|
114
|
+
Returns
|
115
|
+
-------
|
116
|
+
str
|
117
|
+
Unique identifier generated from the data within a record packet.
|
118
|
+
"""
|
119
|
+
return f"Metadata: {self.metadata}\nDataframe dimensions: {self.to_dataframe().shape}\nDataframe digest: {hashlib.sha256(self.to_dataframe().values.tobytes()).hexdigest()}"
|
120
|
+
|
121
|
+
def __str__(self) -> str:
|
122
|
+
"""Return a string representation of a record packet, with the underlying dataframe anonymized."""
|
123
|
+
return self.to_anonymized_string()
|
@@ -0,0 +1,127 @@
|
|
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
|
+
"""Function definition for registering a plugin with the SDK."""
|
15
|
+
import sys
|
16
|
+
from typing import Literal, Optional, TYPE_CHECKING, Type
|
17
|
+
|
18
|
+
if TYPE_CHECKING:
|
19
|
+
from another_ayx_python_sdk.core.plugin import Plugin # noqa: F401
|
20
|
+
from another_ayx_python_sdk.providers.e1_provider.e1_plugin_proxy import ( # noqa: F401
|
21
|
+
E1PluginProxy,
|
22
|
+
)
|
23
|
+
|
24
|
+
_ProviderTypes = Literal["e1", "e2", "file"]
|
25
|
+
|
26
|
+
|
27
|
+
def register_plugin(
|
28
|
+
plugin_class: Type["Plugin"], version: Optional[str] = None
|
29
|
+
) -> Optional[Type["E1PluginProxy"]]:
|
30
|
+
"""
|
31
|
+
Register a plugin with the SDK.
|
32
|
+
|
33
|
+
The return value of this function should be assigned to a variable
|
34
|
+
called AyxPlugin in the entrypoint to the tool in order for the
|
35
|
+
E1 Python SDK to properly recognize it.
|
36
|
+
|
37
|
+
Parameters
|
38
|
+
----------
|
39
|
+
plugin_class
|
40
|
+
Python Plugin to register. This plugin is written using the Python SDK.
|
41
|
+
|
42
|
+
Returns
|
43
|
+
-------
|
44
|
+
E1PluginProxy, optional
|
45
|
+
The Plugin, subclassed for the provider that it was registered with.
|
46
|
+
|
47
|
+
"""
|
48
|
+
# TODO: Add v2 registration
|
49
|
+
return {"e1": register_e1_plugin, "file": register_file_provider_plugin}[
|
50
|
+
_get_provider()
|
51
|
+
](plugin_class, version)
|
52
|
+
|
53
|
+
|
54
|
+
def register_e1_plugin(
|
55
|
+
user_plugin_class: Type["Plugin"], version: Optional[str] = None
|
56
|
+
) -> Type["E1PluginProxy"]:
|
57
|
+
"""
|
58
|
+
Register a plugin with the E1 SDK Provider.
|
59
|
+
|
60
|
+
Parameters
|
61
|
+
----------
|
62
|
+
user_plugin_class
|
63
|
+
Python Plugin to register.
|
64
|
+
|
65
|
+
version
|
66
|
+
Version of the tool being used.
|
67
|
+
|
68
|
+
Returns
|
69
|
+
-------
|
70
|
+
E1PluginProxy
|
71
|
+
Copy of the passed-in Plugin, subclassed for the E1 Provider.
|
72
|
+
|
73
|
+
"""
|
74
|
+
# This makes a copy of the plugin proxy class. This is an unfortunate requirement
|
75
|
+
# given the state of the existing python SDK since the environment shares an
|
76
|
+
# interpreter. Without making a copy of the plugin proxy class on registration
|
77
|
+
# the stateful property setting of user_plugin_class would be overwritten each
|
78
|
+
# time a plugin loads and calls register_e1_plugin, since the library is only
|
79
|
+
# loaded into memory once.
|
80
|
+
from another_ayx_python_sdk.providers.e1_provider.e1_plugin_proxy import ( # noqa: F811
|
81
|
+
E1PluginProxy,
|
82
|
+
)
|
83
|
+
|
84
|
+
class ProxyPluginCopy(E1PluginProxy):
|
85
|
+
pass
|
86
|
+
|
87
|
+
ProxyPluginCopy.user_plugin_class = user_plugin_class
|
88
|
+
tool_directory_name = user_plugin_class.__name__
|
89
|
+
|
90
|
+
if version:
|
91
|
+
tool_directory_name = f"{tool_directory_name}_v{version}"
|
92
|
+
ProxyPluginCopy.user_plugin_directory_name = tool_directory_name
|
93
|
+
|
94
|
+
return ProxyPluginCopy
|
95
|
+
|
96
|
+
|
97
|
+
def register_file_provider_plugin(
|
98
|
+
user_plugin_class: Type["Plugin"], version: Optional[str] = None
|
99
|
+
) -> None:
|
100
|
+
"""
|
101
|
+
Register a plugin with the File Provider.
|
102
|
+
|
103
|
+
Parameters
|
104
|
+
----------
|
105
|
+
user_plugin_class
|
106
|
+
Python Plugin to register.
|
107
|
+
"""
|
108
|
+
import another_ayx_python_sdk.providers.file_provider.file_provider as ayx_file_provider
|
109
|
+
|
110
|
+
ayx_file_provider.user_plugin_class = user_plugin_class
|
111
|
+
return None
|
112
|
+
|
113
|
+
|
114
|
+
def _get_provider() -> _ProviderTypes:
|
115
|
+
"""
|
116
|
+
Determine which provider is being used to run the Plugin.
|
117
|
+
|
118
|
+
Returns
|
119
|
+
-------
|
120
|
+
_ProviderTypes
|
121
|
+
A Literal that states which provider is being used: e1, e2 (AMP), or file.
|
122
|
+
"""
|
123
|
+
if "AlteryxEngineCmd.exe" in sys.executable:
|
124
|
+
return "e1"
|
125
|
+
|
126
|
+
# For now, assume if it's not the e1 provider, then it's the file provider
|
127
|
+
return "file"
|
@@ -0,0 +1,191 @@
|
|
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
|
+
"""Convenience functions, classes, and fixtures for user-generated unit testing."""
|
15
|
+
import asyncio
|
16
|
+
from collections import namedtuple
|
17
|
+
from dataclasses import dataclass
|
18
|
+
from typing import Dict, List, Optional, Type
|
19
|
+
|
20
|
+
from another_ayx_python_sdk.core import Anchor, PluginV2
|
21
|
+
from another_ayx_python_sdk.providers.amp_provider import AMPProviderV2
|
22
|
+
from another_ayx_python_sdk.providers.amp_provider.sdk_tool_service_v2 import SdkToolServiceV2
|
23
|
+
|
24
|
+
import pyarrow as pa
|
25
|
+
|
26
|
+
|
27
|
+
@dataclass
|
28
|
+
class _IncomingConnection:
|
29
|
+
name: str
|
30
|
+
metadata: Optional[pa.schema]
|
31
|
+
|
32
|
+
|
33
|
+
@dataclass
|
34
|
+
class _IncomingAnchor:
|
35
|
+
name: str
|
36
|
+
connections: List[_IncomingConnection]
|
37
|
+
|
38
|
+
|
39
|
+
@dataclass
|
40
|
+
class _OutgoingAnchor:
|
41
|
+
name: str
|
42
|
+
num_connections: int
|
43
|
+
metadata: Optional[pa.schema]
|
44
|
+
|
45
|
+
|
46
|
+
@dataclass
|
47
|
+
class _PluginInitializationData:
|
48
|
+
configXml: str # noqa
|
49
|
+
incomingAnchors: List[_IncomingAnchor] # noqa
|
50
|
+
outgoingAnchors: List[_OutgoingAnchor] # noqa
|
51
|
+
|
52
|
+
|
53
|
+
@dataclass
|
54
|
+
class _DummyCtrlIn:
|
55
|
+
plugin_initialization_data: _PluginInitializationData
|
56
|
+
|
57
|
+
|
58
|
+
BatchTuple = namedtuple("BatchTuple", ["input_data", "expected_output_data"])
|
59
|
+
|
60
|
+
|
61
|
+
class SdkToolTestService:
|
62
|
+
"""A minimal in-process client for testing user plugins."""
|
63
|
+
|
64
|
+
MAPPING = ["NONE", "INFO", "WARN", "ERROR", "FILEINPUT", "FILEOUTPUT"]
|
65
|
+
|
66
|
+
def __init__(
|
67
|
+
self,
|
68
|
+
plugin_class: Type[PluginV2],
|
69
|
+
input_anchor_config: Dict[str, Optional[pa.schema]],
|
70
|
+
output_anchor_config: Dict[str, Optional[pa.schema]],
|
71
|
+
config_mock: str,
|
72
|
+
):
|
73
|
+
self.service = SdkToolServiceV2()
|
74
|
+
|
75
|
+
provider = AMPProviderV2()
|
76
|
+
incoming_anchors = [
|
77
|
+
_IncomingAnchor(
|
78
|
+
name=key,
|
79
|
+
connections=[
|
80
|
+
_IncomingConnection(
|
81
|
+
name=str(i + 1), metadata=input_anchor_config.get(key)
|
82
|
+
)
|
83
|
+
],
|
84
|
+
)
|
85
|
+
for i, key in enumerate(input_anchor_config.keys())
|
86
|
+
]
|
87
|
+
|
88
|
+
outgoing_anchors = [
|
89
|
+
_OutgoingAnchor(
|
90
|
+
name=key, num_connections=1, metadata=output_anchor_config.get(key)
|
91
|
+
)
|
92
|
+
for key in output_anchor_config.keys()
|
93
|
+
]
|
94
|
+
|
95
|
+
# TODO: generate/pass config_mock in as a dict/json, convert to xml here
|
96
|
+
init_data = _DummyCtrlIn(
|
97
|
+
_PluginInitializationData(
|
98
|
+
configXml=config_mock,
|
99
|
+
incomingAnchors=incoming_anchors,
|
100
|
+
outgoingAnchors=outgoing_anchors,
|
101
|
+
)
|
102
|
+
)
|
103
|
+
|
104
|
+
provider.set_anchors(init_data)
|
105
|
+
provider.environment.set_tool_config(config_mock)
|
106
|
+
|
107
|
+
self.plugin = plugin_class(provider)
|
108
|
+
self.service.driver.plugin = self.plugin
|
109
|
+
|
110
|
+
self._data_streams: Dict[str, List[pa.RecordBatch]] = {}
|
111
|
+
self._io_stream: List[str] = []
|
112
|
+
# TODO: auto-generate plugin initialization from configXML
|
113
|
+
|
114
|
+
@property
|
115
|
+
def io_stream(self) -> List[str]:
|
116
|
+
"""
|
117
|
+
Store any strings sent over through provider.io.
|
118
|
+
|
119
|
+
This is roughly the format the resulting strings follow:
|
120
|
+
"(INFO|WARN|ERROR):(.*)"
|
121
|
+
For example, this provider.io call in the plugin code:
|
122
|
+
self.provider.io.info("Test Code")
|
123
|
+
would show up as "INFO:Test Code" in self.io_stream.
|
124
|
+
|
125
|
+
Returns
|
126
|
+
-------
|
127
|
+
List[str]
|
128
|
+
All strings generated by provider.io calls within the plugin code.
|
129
|
+
"""
|
130
|
+
return self._io_stream
|
131
|
+
|
132
|
+
@property
|
133
|
+
def data_streams(self) -> Dict[str, List[pa.RecordBatch]]:
|
134
|
+
"""
|
135
|
+
Capture any data written via provider.io.write_to_anchor().
|
136
|
+
|
137
|
+
The completed stream is represented by a dictionary, typed like so:
|
138
|
+
{
|
139
|
+
"<Output Anchor name>": [pa.RecordBatch]
|
140
|
+
}
|
141
|
+
If provider.io.write_to_anchor is never called, the data_streams attribute should be an empty dictionary.
|
142
|
+
|
143
|
+
Returns
|
144
|
+
-------
|
145
|
+
Dict[str, List[pa.RecordBatch]
|
146
|
+
A mapping between output anchor names and the corresponding list of RecordBatches
|
147
|
+
written to that output anchor.
|
148
|
+
"""
|
149
|
+
return self._data_streams
|
150
|
+
|
151
|
+
def run_on_record_batch(self, batch: pa.RecordBatch, anchor: Anchor) -> None:
|
152
|
+
"""Prepare and run the plugin's on_record_batch method, and capture the I/O and data streams."""
|
153
|
+
self._flush_and_save_streams()
|
154
|
+
self.service.driver.record_batch_received(batch, anchor)
|
155
|
+
self._flush_and_save_streams()
|
156
|
+
|
157
|
+
def run_on_incoming_connection_complete(self, anchor: Anchor) -> None:
|
158
|
+
"""Prepare and run the plugin's on_incoming_connection_complete method, and capture the I/O and data streams."""
|
159
|
+
self._flush_and_save_streams()
|
160
|
+
self.service.driver.incoming_connection_complete_callback(anchor)
|
161
|
+
self._flush_and_save_streams()
|
162
|
+
|
163
|
+
def run_on_complete(self) -> None:
|
164
|
+
"""Prepare and run the plugin's on_complete method, and capture the I/O and data streams."""
|
165
|
+
self._flush_and_save_streams()
|
166
|
+
self.service.driver.on_complete_callback()
|
167
|
+
self._flush_and_save_streams()
|
168
|
+
|
169
|
+
def _flush_and_save_streams(self) -> None:
|
170
|
+
outputs: Dict[str, List[pa.Table]] = {}
|
171
|
+
io_outputs: List[str] = []
|
172
|
+
while not self.service.driver.ctrl_io.ctrl_out.empty():
|
173
|
+
item = asyncio.get_event_loop().run_until_complete(
|
174
|
+
self.service.driver.ctrl_io.ctrl_out.get()
|
175
|
+
)
|
176
|
+
io_outputs.append(
|
177
|
+
f"{self.MAPPING[item.output_message.message_type]}:{item.output_message.message}"
|
178
|
+
)
|
179
|
+
while not self.service.driver.record_io.pending_writes.empty():
|
180
|
+
item = asyncio.get_event_loop().run_until_complete(
|
181
|
+
self.service.driver.record_io.pending_writes.get()
|
182
|
+
)
|
183
|
+
if item["anchor_name"] not in outputs.keys():
|
184
|
+
outputs[item["anchor_name"]] = []
|
185
|
+
outputs[item["anchor_name"]].append(
|
186
|
+
pa.Table.from_pydict(item["data"].to_pydict())
|
187
|
+
)
|
188
|
+
self._data_streams = {
|
189
|
+
key: pa.concat_tables(value).to_batches() for key, value in outputs.items()
|
190
|
+
}
|
191
|
+
self._io_stream = io_outputs
|
@@ -0,0 +1,146 @@
|
|
1
|
+
# Copyright (C) 2022 Alteryx, Inc. All rights reserved.
|
2
|
+
#
|
3
|
+
# Licensed under the ALTERYX SDK AND API LICENSE AGREEMENT;
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# https://www.alteryx.com/alteryx-sdk-and-api-license-agreement
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
"""Utility functions definitions for plugin SDK."""
|
15
|
+
|
16
|
+
import datetime
|
17
|
+
from typing import Dict
|
18
|
+
|
19
|
+
from another_ayx_python_sdk.core.field import Field, FieldType
|
20
|
+
|
21
|
+
import pyarrow as pa
|
22
|
+
|
23
|
+
|
24
|
+
def to_date(stdate: str) -> "datetime.date":
|
25
|
+
"""Turn a date represented by a string to a Python date.
|
26
|
+
|
27
|
+
(only the date part and not the time of the day)
|
28
|
+
"""
|
29
|
+
return datetime.datetime.strptime(stdate, "%m/%d/%Y").date()
|
30
|
+
|
31
|
+
|
32
|
+
def to_time(sttime: str) -> "datetime.time":
|
33
|
+
"""Turn a date represented by a string to a Python time."""
|
34
|
+
return datetime.datetime.strptime(sttime, "%H:%M:%S").time()
|
35
|
+
|
36
|
+
|
37
|
+
def to_datetime(stdatetime: str) -> "datetime.datetime":
|
38
|
+
"""Turn a date represented by a string to a Python datetime."""
|
39
|
+
return datetime.datetime.strptime(stdatetime, "%m/%d/%Y %H:%M:%S")
|
40
|
+
|
41
|
+
|
42
|
+
def is_spatial(metadata: "pa.Metadata") -> bool:
|
43
|
+
"""Return true if the given arrow type is a spatial object (string + 'ayx' meta info)."""
|
44
|
+
return metadata.get(b"ayx.source", None) == b"WKT"
|
45
|
+
|
46
|
+
|
47
|
+
def create_schema(col_meta: Dict = {}) -> "pa.Schema":
|
48
|
+
"""Create a Python Arrow Schema given a Dict of Metadata."""
|
49
|
+
fields = []
|
50
|
+
for name, data in col_meta.items():
|
51
|
+
if isinstance(data, dict):
|
52
|
+
fd = Field(
|
53
|
+
name,
|
54
|
+
field_type=data.get("type", FieldType.string),
|
55
|
+
size=data.get("size", 0),
|
56
|
+
scale=data.get("scale", 0),
|
57
|
+
source=data.get("source", ""),
|
58
|
+
description=data.get("description", ""),
|
59
|
+
)
|
60
|
+
else:
|
61
|
+
fd = Field(name, data)
|
62
|
+
fields.append(fd.to_arrow())
|
63
|
+
return pa.schema(fields)
|
64
|
+
|
65
|
+
|
66
|
+
def get_ayx_meta(metaname: str) -> str:
|
67
|
+
"""Add ayx. prefix to metadata name."""
|
68
|
+
if metaname in ["type", "size", "scale", "source", "description"]:
|
69
|
+
return "ayx." + metaname
|
70
|
+
raise ValueError("bad metadata name: " + metaname)
|
71
|
+
|
72
|
+
|
73
|
+
def set_metadata(
|
74
|
+
tbl: "pa.Table", col_meta: Dict = {}, schema: "pa.Schema" = None
|
75
|
+
) -> "pa.Table":
|
76
|
+
"""Store column-level metadata as byte strings.
|
77
|
+
|
78
|
+
Column-level metadata is stored in the table columns schema fields.
|
79
|
+
|
80
|
+
To update the metadata, first new fields are created for all columns.
|
81
|
+
Next a schema is created using the new fields and updated table metadata.
|
82
|
+
Finally a new table is created by replacing the old one's schema, but
|
83
|
+
without copying any data.
|
84
|
+
|
85
|
+
Args:
|
86
|
+
----
|
87
|
+
tbl (pyarrow.Table): The table to store metadata in
|
88
|
+
col_meta: A dictionary with column metadata in the form
|
89
|
+
{
|
90
|
+
'column_1': {'type': FieldType.int64, 'size': 8},
|
91
|
+
'column_2': {'size': 64, 'source': 'something'}
|
92
|
+
}
|
93
|
+
"""
|
94
|
+
# Create updated column fields with new metadata
|
95
|
+
if schema:
|
96
|
+
return pa.Table.from_arrays(list(tbl.itercolumns()), schema=schema)
|
97
|
+
|
98
|
+
if col_meta:
|
99
|
+
fields = []
|
100
|
+
for col in tbl.schema:
|
101
|
+
if col.name in col_meta:
|
102
|
+
# Get updated column metadata
|
103
|
+
metadata = col.metadata.copy() or {}
|
104
|
+
for k, v in col_meta[col.name].items():
|
105
|
+
metadata[get_ayx_meta(k).encode("utf-8")] = str(v).encode("utf-8")
|
106
|
+
# Update field with updated metadata
|
107
|
+
col = pa.field(
|
108
|
+
col.name, col.type, nullable=col.nullable, metadata=metadata
|
109
|
+
)
|
110
|
+
fields.append(col)
|
111
|
+
|
112
|
+
# Create new schema with updated field metadata
|
113
|
+
schema = pa.schema(fields)
|
114
|
+
|
115
|
+
# With updated schema build new table (shouldn't copy data)
|
116
|
+
# tbl = pa.Table.from_batches(tbl.to_batches(), schema)
|
117
|
+
tbl = pa.Table.from_arrays(list(tbl.itercolumns()), schema=schema)
|
118
|
+
|
119
|
+
return tbl
|
120
|
+
|
121
|
+
|
122
|
+
def decode_metadata(metadata: Dict) -> Dict:
|
123
|
+
"""Arrow stores metadata keys and values as bytes."""
|
124
|
+
if not metadata:
|
125
|
+
# None or {} are not decoded
|
126
|
+
return metadata
|
127
|
+
|
128
|
+
decoded = {}
|
129
|
+
for k, v in metadata.items():
|
130
|
+
key = k.decode("utf-8")
|
131
|
+
if key[0:4] == "ayx.":
|
132
|
+
key = key[4:]
|
133
|
+
val = v.decode("utf-8")
|
134
|
+
decoded[key] = val
|
135
|
+
return decoded
|
136
|
+
|
137
|
+
|
138
|
+
def get_metadata(tbl: "pa.Table", col_name: str = "") -> Dict:
|
139
|
+
"""Get all column metadata as dicts or just one column, given col_name."""
|
140
|
+
if col_name:
|
141
|
+
for col in tbl.schema:
|
142
|
+
if col.name == col_name:
|
143
|
+
return decode_metadata(col.metadata)
|
144
|
+
return {}
|
145
|
+
else:
|
146
|
+
return {col.name: decode_metadata(col.metadata) for col in tbl.schema}
|
@@ -0,0 +1,89 @@
|
|
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
|
+
"""Example input tool."""
|
15
|
+
from typing import NamedTuple
|
16
|
+
|
17
|
+
from another_ayx_python_sdk.core import PluginV2
|
18
|
+
from another_ayx_python_sdk.providers.amp_provider.amp_provider_v2 import AMPProviderV2
|
19
|
+
|
20
|
+
from pyarrow import Table
|
21
|
+
|
22
|
+
|
23
|
+
class AyxSdkInput(PluginV2):
|
24
|
+
"""Concrete implementation of an AyxPlugin."""
|
25
|
+
|
26
|
+
def __init__(self, provider: AMPProviderV2) -> None:
|
27
|
+
"""Construct a plugin."""
|
28
|
+
self.provider = provider
|
29
|
+
self.config_value = 0.42
|
30
|
+
self.provider.io.info("Plugin initialized.")
|
31
|
+
|
32
|
+
def on_incoming_connection_complete(self, anchor: NamedTuple) -> None:
|
33
|
+
"""
|
34
|
+
Call when an incoming connection is done sending data including when no data is sent on an optional input anchor.
|
35
|
+
|
36
|
+
This method IS NOT called during update-only mode.
|
37
|
+
|
38
|
+
Parameters
|
39
|
+
----------
|
40
|
+
anchor
|
41
|
+
NamedTuple containing anchor.name and anchor.connection.
|
42
|
+
"""
|
43
|
+
raise NotImplementedError("Input tools don't receive batches.")
|
44
|
+
|
45
|
+
def on_record_batch(self, batch: "Table", anchor: NamedTuple) -> None:
|
46
|
+
"""
|
47
|
+
Process the passed record batch that comes in on the specified anchor.
|
48
|
+
|
49
|
+
The method that gets called whenever the plugin receives a record batch on an input.
|
50
|
+
|
51
|
+
This method IS NOT called during update-only mode.
|
52
|
+
|
53
|
+
Parameters
|
54
|
+
----------
|
55
|
+
batch
|
56
|
+
A pyarrow Table containing the received batch.
|
57
|
+
anchor
|
58
|
+
A namedtuple('Anchor', ['name', 'connection_name']) containing input connection identifiers.
|
59
|
+
"""
|
60
|
+
raise NotImplementedError("Input tools don't receive batches.")
|
61
|
+
|
62
|
+
def on_complete(self) -> None:
|
63
|
+
"""
|
64
|
+
Clean up any plugin resources, or push records for an input tool.
|
65
|
+
|
66
|
+
This method gets called when all other plugin processing is complete.
|
67
|
+
|
68
|
+
In this method, a Plugin designer should perform any cleanup for their plugin.
|
69
|
+
However, if the plugin is an input-type tool (it has no incoming connections),
|
70
|
+
processing (record generation) should occur here.
|
71
|
+
|
72
|
+
Note: A tool with an optional input anchor and no incoming connections should
|
73
|
+
also write any records to output anchors here.
|
74
|
+
"""
|
75
|
+
import pandas as pd
|
76
|
+
import pyarrow as pa
|
77
|
+
|
78
|
+
df = pd.DataFrame(
|
79
|
+
{
|
80
|
+
"x": [1, 2, 3],
|
81
|
+
"y": ["hello", "world", "from ayx_python_sdk!"],
|
82
|
+
"z": [self.config_value, self.config_value, self.config_value],
|
83
|
+
}
|
84
|
+
)
|
85
|
+
|
86
|
+
packet = pa.Table.from_pandas(df)
|
87
|
+
|
88
|
+
self.provider.write_to_anchor("Output", packet)
|
89
|
+
self.provider.io.info("AyxSdkInput tool done.")
|