another-ayx-python-sdk 2.4.23__py3-none-any.whl → 2.4.24__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.23.dist-info → another_ayx_python_sdk-2.4.24.dist-info}/METADATA +2 -2
- {another_ayx_python_sdk-2.4.23.dist-info → another_ayx_python_sdk-2.4.24.dist-info}/RECORD +212 -7
- {another_ayx_python_sdk-2.4.23.dist-info → another_ayx_python_sdk-2.4.24.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
- {another_ayx_python_sdk-2.4.23.dist-info → another_ayx_python_sdk-2.4.24.dist-info}/WHEEL +0 -0
- {another_ayx_python_sdk-2.4.23.dist-info → another_ayx_python_sdk-2.4.24.dist-info}/entry_points.txt +0 -0
- {another_ayx_python_sdk-2.4.23.dist-info → another_ayx_python_sdk-2.4.24.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,102 @@
|
|
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 multiple input connection anchor tool."""
|
15
|
+
from typing import Dict, TYPE_CHECKING
|
16
|
+
|
17
|
+
from another_ayx_python_sdk.core import PluginV2
|
18
|
+
|
19
|
+
|
20
|
+
if TYPE_CHECKING:
|
21
|
+
import pyarrow as pa
|
22
|
+
from another_ayx_python_sdk.providers.amp_provider.amp_provider_v2 import AMPProviderV2
|
23
|
+
from another_ayx_python_sdk.core.constants import Anchor
|
24
|
+
|
25
|
+
|
26
|
+
class AyxSdkMultiConnectionsMultiOutputAnchor(PluginV2):
|
27
|
+
"""Concrete implementation of an AyxPlugin."""
|
28
|
+
|
29
|
+
def __init__(self, provider: "AMPProviderV2") -> None:
|
30
|
+
"""Construct a plugin."""
|
31
|
+
self.provider = provider
|
32
|
+
self.provider.io.info("Plugin initialized.")
|
33
|
+
try:
|
34
|
+
self.conn_to_output = self.get_conn_map()
|
35
|
+
except Exception as e:
|
36
|
+
self.provider.io.error(f"Failed to set conn map {repr(e)}")
|
37
|
+
|
38
|
+
def get_conn_map(self) -> Dict[str, str]:
|
39
|
+
"""Map the connections of Input anchor to Output anchors."""
|
40
|
+
connections = self.provider.incoming_anchors["Input"].keys()
|
41
|
+
conn_to_output = {}
|
42
|
+
for name in connections:
|
43
|
+
conn_num = int(name.strip("#"))
|
44
|
+
if conn_num >= 5:
|
45
|
+
# Add any additional input to the last existing anchor.
|
46
|
+
conn_to_output[name] = f"Output5"
|
47
|
+
else:
|
48
|
+
conn_to_output[name] = f"Output{conn_num}"
|
49
|
+
return conn_to_output
|
50
|
+
|
51
|
+
def on_incoming_connection_complete(self, anchor: "Anchor") -> None:
|
52
|
+
"""
|
53
|
+
Call when an incoming connection is done sending data including when no data is sent on an optional input anchor.
|
54
|
+
|
55
|
+
This method IS NOT called during update-only mode.
|
56
|
+
|
57
|
+
Parameters
|
58
|
+
----------
|
59
|
+
anchor
|
60
|
+
NamedTuple containing anchor.name and anchor.connection.
|
61
|
+
"""
|
62
|
+
self.provider.io.info(
|
63
|
+
f"Received complete update from {anchor.name}:{anchor.connection}."
|
64
|
+
)
|
65
|
+
|
66
|
+
def on_record_batch(self, table: "pa.Table", anchor: "Anchor") -> None:
|
67
|
+
"""
|
68
|
+
Process the passed record batch.
|
69
|
+
|
70
|
+
The method that gets called whenever the plugin receives a record batch on an input.
|
71
|
+
|
72
|
+
This method IS NOT called during update-only mode.
|
73
|
+
|
74
|
+
Parameters
|
75
|
+
----------
|
76
|
+
batch
|
77
|
+
A pyarrow Table containing the received batch.
|
78
|
+
anchor
|
79
|
+
A namedtuple('Anchor', ['name', 'connection']) containing input connection identifiers.
|
80
|
+
"""
|
81
|
+
try:
|
82
|
+
out_anchor = self.conn_to_output[anchor.connection]
|
83
|
+
self.provider.write_to_anchor(out_anchor, table)
|
84
|
+
except Exception as e:
|
85
|
+
self.provider.io.warn(
|
86
|
+
f"Failed to write batch to output anchor. \n{repr(e)}"
|
87
|
+
)
|
88
|
+
|
89
|
+
def on_complete(self) -> None:
|
90
|
+
"""
|
91
|
+
Clean up any plugin resources, or push records for an input tool.
|
92
|
+
|
93
|
+
This method gets called when all other plugin processing is complete.
|
94
|
+
|
95
|
+
In this method, a Plugin designer should perform any cleanup for their plugin.
|
96
|
+
However, if the plugin is an input-type tool (it has no incoming connections),
|
97
|
+
processing (record generation) should occur here.
|
98
|
+
|
99
|
+
Note: A tool with an optional input anchor and no incoming connections should
|
100
|
+
also write any records to output anchors here.
|
101
|
+
"""
|
102
|
+
self.provider.io.info("AyxSdkMultiConnectionsMultiOutputAnchor tool done.")
|
@@ -0,0 +1,84 @@
|
|
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 multiple input anchor tool."""
|
15
|
+
from typing import TYPE_CHECKING
|
16
|
+
|
17
|
+
from another_ayx_python_sdk.core import PluginV2
|
18
|
+
|
19
|
+
if TYPE_CHECKING:
|
20
|
+
from another_ayx_python_sdk.providers.amp_provider.amp_provider_v2 import AMPProviderV2
|
21
|
+
import pyarrow as pa
|
22
|
+
from another_ayx_python_sdk.core.constants import Anchor
|
23
|
+
|
24
|
+
|
25
|
+
class AyxSdkMultipleInputAnchors(PluginV2):
|
26
|
+
"""Concrete implementation of an AyxPlugin."""
|
27
|
+
|
28
|
+
def __init__(self, provider: "AMPProviderV2") -> None:
|
29
|
+
"""Construct a plugin."""
|
30
|
+
self.provider = provider
|
31
|
+
self.output_anchor_name = "Output"
|
32
|
+
self.provider.io.info("Plugin initialized.")
|
33
|
+
|
34
|
+
def on_incoming_connection_complete(self, anchor: "Anchor") -> None:
|
35
|
+
"""
|
36
|
+
Call when an incoming connection is done sending data including when no data is sent on an optional input anchor.
|
37
|
+
|
38
|
+
This method IS NOT called during update-only mode.
|
39
|
+
|
40
|
+
Parameters
|
41
|
+
----------
|
42
|
+
anchor
|
43
|
+
NamedTuple containing anchor.name and anchor.connection.
|
44
|
+
"""
|
45
|
+
self.provider.io.info(
|
46
|
+
f"Received complete update from {anchor.name}:{anchor.connection}."
|
47
|
+
)
|
48
|
+
|
49
|
+
def on_record_batch(self, table: "pa.Table", anchor: "Anchor") -> None:
|
50
|
+
"""
|
51
|
+
Process the passed record batch.
|
52
|
+
|
53
|
+
The method that gets called whenever the plugin receives a record batch on an input.
|
54
|
+
|
55
|
+
This method IS NOT called during update-only mode.
|
56
|
+
|
57
|
+
Parameters
|
58
|
+
----------
|
59
|
+
batch
|
60
|
+
A pyarrow Table containing the received batch.
|
61
|
+
anchor
|
62
|
+
A namedtuple('Anchor', ['name', 'connection']) containing input connection identifiers.
|
63
|
+
"""
|
64
|
+
try:
|
65
|
+
self.provider.write_to_anchor(self.output_anchor_name, table)
|
66
|
+
except Exception as e:
|
67
|
+
self.provider.io.warn(
|
68
|
+
f"Error Occured while writing to anchor {anchor.name} \n {repr(e)}"
|
69
|
+
)
|
70
|
+
|
71
|
+
def on_complete(self) -> None:
|
72
|
+
"""
|
73
|
+
Clean up any plugin resources, or push records for an input tool.
|
74
|
+
|
75
|
+
This method gets called when all other plugin processing is complete.
|
76
|
+
|
77
|
+
In this method, a Plugin designer should perform any cleanup for their plugin.
|
78
|
+
However, if the plugin is an input-type tool (it has no incoming connections),
|
79
|
+
processing (record generation) should occur here.
|
80
|
+
|
81
|
+
Note: A tool with an optional input anchor and no incoming connections should
|
82
|
+
also write any records to output anchors here.
|
83
|
+
"""
|
84
|
+
self.provider.io.info("AyxSdkMultipleInputAnchors tool done.")
|
@@ -0,0 +1,96 @@
|
|
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 pass through tool."""
|
15
|
+
from another_ayx_python_sdk.core import (
|
16
|
+
Anchor,
|
17
|
+
PluginV2,
|
18
|
+
)
|
19
|
+
from another_ayx_python_sdk.providers.amp_provider.amp_provider_v2 import AMPProviderV2
|
20
|
+
|
21
|
+
from pandas.core.dtypes.common import is_integer_dtype
|
22
|
+
|
23
|
+
from pyarrow import RecordBatch, Table
|
24
|
+
|
25
|
+
|
26
|
+
class AyxSdkMultipleOutputAnchors(PluginV2):
|
27
|
+
"""A sample Plugin that filters numeric data for odd and even values."""
|
28
|
+
|
29
|
+
def __init__(self, provider: "AMPProviderV2"):
|
30
|
+
"""Construct the plugin."""
|
31
|
+
self.provider = provider
|
32
|
+
self.provider.io.info("AyxSdkMultipleOutputAnchors tool started.")
|
33
|
+
|
34
|
+
def on_record_batch(self, batch: "Table", anchor: "Anchor") -> None:
|
35
|
+
"""
|
36
|
+
Process the passed record batch.
|
37
|
+
|
38
|
+
The method that gets called whenever the plugin receives a record batch on an input.
|
39
|
+
|
40
|
+
This method IS NOT called during update-only mode.
|
41
|
+
|
42
|
+
Parameters
|
43
|
+
----------
|
44
|
+
batch
|
45
|
+
A pyarrow Table containing the received batch.
|
46
|
+
anchor
|
47
|
+
A namedtuple('Anchor', ['name', 'connection']) containing input connection identifiers.
|
48
|
+
"""
|
49
|
+
metadata = batch.schema
|
50
|
+
if not any([field_name == "Value" for field_name in metadata.names]):
|
51
|
+
raise RuntimeError(
|
52
|
+
"Incoming data must contain a column with the name 'Value'"
|
53
|
+
)
|
54
|
+
input_dataframe = batch.to_pandas()
|
55
|
+
|
56
|
+
if not is_integer_dtype(input_dataframe["Value"]):
|
57
|
+
raise RuntimeError("'Value' column must be of 'int' data type")
|
58
|
+
|
59
|
+
grouped = input_dataframe.groupby("Value")
|
60
|
+
odds = grouped.filter(lambda row: (row["Value"] % 2 == 1).any())
|
61
|
+
evens = grouped.filter(lambda row: (row["Value"] % 2 == 0).any())
|
62
|
+
|
63
|
+
odd_batch = RecordBatch.from_pandas(odds, preserve_index=False)
|
64
|
+
even_batch = RecordBatch.from_pandas(evens, preserve_index=False)
|
65
|
+
self.provider.write_to_anchor("Output1", odd_batch)
|
66
|
+
self.provider.write_to_anchor("Output2", even_batch)
|
67
|
+
|
68
|
+
def on_incoming_connection_complete(self, anchor: "Anchor") -> None:
|
69
|
+
"""
|
70
|
+
Call when an incoming connection is done sending data including when no data is sent on an optional input anchor.
|
71
|
+
|
72
|
+
This method IS NOT called during update-only mode.
|
73
|
+
|
74
|
+
Parameters
|
75
|
+
----------
|
76
|
+
anchor
|
77
|
+
NamedTuple containing anchor.name and anchor.connection.
|
78
|
+
"""
|
79
|
+
self.provider.io.info(
|
80
|
+
f"Received complete update from {anchor.name}:{anchor.connection}."
|
81
|
+
)
|
82
|
+
|
83
|
+
def on_complete(self) -> None:
|
84
|
+
"""
|
85
|
+
Clean up any plugin resources, or push records for an input tool.
|
86
|
+
|
87
|
+
This method gets called when all other plugin processing is complete.
|
88
|
+
|
89
|
+
In this method, a Plugin designer should perform any cleanup for their plugin.
|
90
|
+
However, if the plugin is an input-type tool (it has no incoming connections),
|
91
|
+
processing (record generation) should occur here.
|
92
|
+
|
93
|
+
Note: A tool with an optional input anchor and no incoming connections should
|
94
|
+
also write any records to output anchors here.
|
95
|
+
"""
|
96
|
+
self.provider.io.info("AyxSdkMultipleOutputAnchors tool done.")
|
@@ -0,0 +1,94 @@
|
|
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 optional input anchor tool."""
|
15
|
+
from typing import TYPE_CHECKING
|
16
|
+
|
17
|
+
from another_ayx_python_sdk.core import PluginV2
|
18
|
+
|
19
|
+
import pyarrow as pa
|
20
|
+
|
21
|
+
if TYPE_CHECKING:
|
22
|
+
from another_ayx_python_sdk.providers.amp_provider.amp_provider_v2 import AMPProviderV2
|
23
|
+
from another_ayx_python_sdk.core.constants import Anchor
|
24
|
+
|
25
|
+
|
26
|
+
class AyxSdkOptionalInputAnchor(PluginV2):
|
27
|
+
"""Concrete implementation of an AyxPlugin."""
|
28
|
+
|
29
|
+
def __init__(self, provider: "AMPProviderV2") -> None:
|
30
|
+
"""Construct a plugin."""
|
31
|
+
self.provider = provider
|
32
|
+
self.config_value = 0.42
|
33
|
+
self.output_anchor = self.provider.outgoing_anchors["Output"]
|
34
|
+
self.input_anchor = self.provider.incoming_anchors["Input"]
|
35
|
+
self.provider.io.info("Plugin initialized.")
|
36
|
+
|
37
|
+
def on_incoming_connection_complete(self, anchor: "Anchor") -> None:
|
38
|
+
"""
|
39
|
+
Call when an incoming connection is done sending data including when no data is sent on an optional input anchor.
|
40
|
+
|
41
|
+
This method IS NOT called during update-only mode.
|
42
|
+
|
43
|
+
Parameters
|
44
|
+
----------
|
45
|
+
anchor
|
46
|
+
NamedTuple containing anchor.name and anchor.connection.
|
47
|
+
"""
|
48
|
+
self.provider.io.info(
|
49
|
+
f"Received complete update from {anchor.name}:{anchor.connection}."
|
50
|
+
)
|
51
|
+
|
52
|
+
def on_record_batch(self, batch: "pa.Table", anchor: "Anchor") -> None:
|
53
|
+
"""
|
54
|
+
Process the passed record batch.
|
55
|
+
|
56
|
+
The method that gets called whenever the plugin receives a record batch on an input.
|
57
|
+
|
58
|
+
This method IS NOT called during update-only mode.
|
59
|
+
|
60
|
+
Parameters
|
61
|
+
----------
|
62
|
+
batch
|
63
|
+
A pyarrow Table containing the received batch.
|
64
|
+
anchor
|
65
|
+
A namedtuple('Anchor', ['name', 'connection']) containing input connection identifiers.
|
66
|
+
"""
|
67
|
+
try:
|
68
|
+
self.provider.write_to_anchor("Output", batch)
|
69
|
+
except Exception as e:
|
70
|
+
self.provider.io.warn(
|
71
|
+
f"Error Occured while writing to anchor {anchor.name} \n {repr(e)}"
|
72
|
+
)
|
73
|
+
|
74
|
+
def on_complete(self) -> None:
|
75
|
+
"""
|
76
|
+
Clean up any plugin resources, or push records for an input tool.
|
77
|
+
|
78
|
+
This method gets called when all other plugin processing is complete.
|
79
|
+
|
80
|
+
In this method, a Plugin designer should perform any cleanup for their plugin.
|
81
|
+
However, if the plugin is an input-type tool (it has no incoming connections),
|
82
|
+
processing (record generation) should occur here.
|
83
|
+
|
84
|
+
Note: A tool with an optional input anchor and no incoming connections should
|
85
|
+
also write any records to output anchors here.
|
86
|
+
"""
|
87
|
+
if len(self.input_anchor.keys()) == 0:
|
88
|
+
import pandas as pd
|
89
|
+
|
90
|
+
df = pd.DataFrame({"OptionalField": [self.config_value]})
|
91
|
+
batch_to_send = pa.RecordBatch.from_pandas(df=df, preserve_index=False)
|
92
|
+
self.provider.write_to_anchor("Output", batch_to_send)
|
93
|
+
|
94
|
+
self.provider.io.info("AyxSdkOptionalInputAnchor tool done.")
|
@@ -0,0 +1,78 @@
|
|
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 output tool."""
|
15
|
+
|
16
|
+
from another_ayx_python_sdk.core import (
|
17
|
+
Anchor,
|
18
|
+
PluginV2,
|
19
|
+
)
|
20
|
+
from another_ayx_python_sdk.providers.amp_provider.amp_provider_v2 import AMPProviderV2
|
21
|
+
|
22
|
+
import pyarrow as pa
|
23
|
+
|
24
|
+
|
25
|
+
class AyxSdkOutput(PluginV2):
|
26
|
+
"""A sample Plugin that passes data from an input connection to an output connection."""
|
27
|
+
|
28
|
+
def __init__(self, provider: AMPProviderV2):
|
29
|
+
"""Construct a plugin."""
|
30
|
+
self.provider = provider
|
31
|
+
self.provider.io.info("AyxSdkOutput tool started")
|
32
|
+
|
33
|
+
def on_record_batch(self, batch: "pa.Table", anchor: Anchor) -> None:
|
34
|
+
"""
|
35
|
+
Process the passed record batch.
|
36
|
+
|
37
|
+
The method that gets called whenever the plugin receives a record batch on an input.
|
38
|
+
|
39
|
+
This method IS NOT called during update-only mode.
|
40
|
+
|
41
|
+
Parameters
|
42
|
+
----------
|
43
|
+
batch
|
44
|
+
A pyarrow Table containing the received batch.
|
45
|
+
anchor
|
46
|
+
A namedtuple('Anchor', ['name', 'connection']) containing input connection identifiers.
|
47
|
+
"""
|
48
|
+
self.provider.io.info(batch.to_string().replace("\n", " | "))
|
49
|
+
|
50
|
+
def on_incoming_connection_complete(self, anchor: Anchor) -> None:
|
51
|
+
"""
|
52
|
+
Call when an incoming connection is done sending data including when no data is sent on an optional input anchor.
|
53
|
+
|
54
|
+
This method IS NOT called during update-only mode.
|
55
|
+
|
56
|
+
Parameters
|
57
|
+
----------
|
58
|
+
anchor
|
59
|
+
NamedTuple containing anchor.name and anchor.connection.
|
60
|
+
"""
|
61
|
+
self.provider.io.info(
|
62
|
+
f"Received complete update from {anchor.name}:{anchor.connection}."
|
63
|
+
)
|
64
|
+
|
65
|
+
def on_complete(self) -> None:
|
66
|
+
"""
|
67
|
+
Clean up any plugin resources, or push records for an input tool.
|
68
|
+
|
69
|
+
This method gets called when all other plugin processing is complete.
|
70
|
+
|
71
|
+
In this method, a Plugin designer should perform any cleanup for their plugin.
|
72
|
+
However, if the plugin is an input-type tool (it has no incoming connections),
|
73
|
+
processing (record generation) should occur here.
|
74
|
+
|
75
|
+
Note: A tool with an optional input anchor and no incoming connections should
|
76
|
+
also write any records to output anchors here.
|
77
|
+
"""
|
78
|
+
self.provider.io.info(f"AyxSdkOutput tool done.")
|
@@ -0,0 +1,82 @@
|
|
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
|
+
|
15
|
+
"""Example pass through tool."""
|
16
|
+
from typing import TYPE_CHECKING
|
17
|
+
|
18
|
+
from another_ayx_python_sdk.core import (
|
19
|
+
Anchor,
|
20
|
+
PluginV2,
|
21
|
+
)
|
22
|
+
from another_ayx_python_sdk.providers.amp_provider.amp_provider_v2 import AMPProviderV2
|
23
|
+
|
24
|
+
if TYPE_CHECKING:
|
25
|
+
import pyarrow as pa
|
26
|
+
|
27
|
+
|
28
|
+
class AyxSdkPassThrough(PluginV2):
|
29
|
+
"""A sample Plugin that passes data from an input connection to an output connection."""
|
30
|
+
|
31
|
+
def __init__(self, provider: AMPProviderV2):
|
32
|
+
"""Construct the plugin."""
|
33
|
+
self.name = "AyxSdkPassThrough"
|
34
|
+
self.provider = provider
|
35
|
+
self.provider.io.info(f"{self.name} tool started")
|
36
|
+
|
37
|
+
def on_record_batch(self, batch: "pa.Table", anchor: Anchor) -> None:
|
38
|
+
"""
|
39
|
+
Process the passed record batch.
|
40
|
+
|
41
|
+
The method that gets called whenever the plugin receives a record batch on an input.
|
42
|
+
|
43
|
+
This method IS NOT called during update-only mode.
|
44
|
+
|
45
|
+
Parameters
|
46
|
+
----------
|
47
|
+
batch
|
48
|
+
A pyarrow Table containing the received batch.
|
49
|
+
anchor
|
50
|
+
A namedtuple('Anchor', ['name', 'connection']) containing input connection identifiers.
|
51
|
+
"""
|
52
|
+
self.provider.write_to_anchor("Output", batch)
|
53
|
+
|
54
|
+
def on_incoming_connection_complete(self, anchor: Anchor) -> None:
|
55
|
+
"""
|
56
|
+
Call when an incoming connection is done sending data including when no data is sent on an optional input anchor.
|
57
|
+
|
58
|
+
This method IS NOT called during update-only mode.
|
59
|
+
|
60
|
+
Parameters
|
61
|
+
----------
|
62
|
+
anchor
|
63
|
+
NamedTuple containing anchor.name and anchor.connection.
|
64
|
+
"""
|
65
|
+
self.provider.io.info(
|
66
|
+
f"Received complete update from {anchor.name}:{anchor.connection}."
|
67
|
+
)
|
68
|
+
|
69
|
+
def on_complete(self) -> None:
|
70
|
+
"""
|
71
|
+
Clean up any plugin resources, or push records for an input tool.
|
72
|
+
|
73
|
+
This method gets called when all other plugin processing is complete.
|
74
|
+
|
75
|
+
In this method, a Plugin designer should perform any cleanup for their plugin.
|
76
|
+
However, if the plugin is an input-type tool (it has no incoming connections),
|
77
|
+
processing (record generation) should occur here.
|
78
|
+
|
79
|
+
Note: A tool with an optional input anchor and no incoming connections should
|
80
|
+
also write any records to output anchors here.
|
81
|
+
"""
|
82
|
+
self.provider.io.info(f"{self.name} tool done.")
|
@@ -0,0 +1,14 @@
|
|
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
|
+
"""Alteryx Python SDK: RecordProviders."""
|
@@ -0,0 +1,41 @@
|
|
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
|
+
"""Alteryx Python SDK: AMP Provider."""
|
15
|
+
|
16
|
+
from .amp_environment import AMPEnvironment
|
17
|
+
from .amp_environment_v2 import AMPEnvironmentV2
|
18
|
+
from .amp_input_anchor import AMPInputAnchor
|
19
|
+
from .amp_input_connection import AMPInputConnection
|
20
|
+
from .amp_driver import AMPDriver # noqa: I100
|
21
|
+
from .amp_io import AMPIO
|
22
|
+
from .amp_io_components import ControlIOBuffer, StreamIOBuffer
|
23
|
+
from .amp_output_anchor import AMPOutputAnchor
|
24
|
+
from .amp_provider import AMPProvider
|
25
|
+
from .amp_provider_v2 import AMPProviderV2
|
26
|
+
from .amp_record_packet import AMPRecordPacket
|
27
|
+
|
28
|
+
__all__ = [
|
29
|
+
"ControlIOBuffer",
|
30
|
+
"StreamIOBuffer",
|
31
|
+
"AMPDriver",
|
32
|
+
"AMPEnvironment",
|
33
|
+
"AMPEnvironmentV2",
|
34
|
+
"AMPInputAnchor",
|
35
|
+
"AMPInputConnection",
|
36
|
+
"AMPIO",
|
37
|
+
"AMPOutputAnchor",
|
38
|
+
"AMPProvider",
|
39
|
+
"AMPProviderV2",
|
40
|
+
"AMPRecordPacket",
|
41
|
+
]
|
@@ -0,0 +1,85 @@
|
|
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
|
+
"""Entrypoint for tracer bullet application."""
|
15
|
+
import asyncio
|
16
|
+
import logging
|
17
|
+
|
18
|
+
from another_ayx_python_sdk.providers.amp_provider.amp_driver import AMPDriver
|
19
|
+
from another_ayx_python_sdk.providers.amp_provider.logger_config import configure_logger
|
20
|
+
from another_ayx_python_sdk.providers.amp_provider.plugin_class_loader import load_plugin_class
|
21
|
+
from another_ayx_python_sdk.providers.amp_provider.sdk_tool_runner import SdkToolRunner
|
22
|
+
|
23
|
+
|
24
|
+
import typer
|
25
|
+
|
26
|
+
app = typer.Typer()
|
27
|
+
|
28
|
+
|
29
|
+
@app.command()
|
30
|
+
def version() -> None:
|
31
|
+
"""Get the version of the CLI."""
|
32
|
+
typer.echo("Version 1.0.0")
|
33
|
+
|
34
|
+
|
35
|
+
@app.command()
|
36
|
+
def start_sdk_tool_service(
|
37
|
+
plugins_package: str,
|
38
|
+
tool_name: str,
|
39
|
+
sdk_engine_server_address: str = "localhost:6500",
|
40
|
+
) -> None:
|
41
|
+
"""Start the SDK Tool service."""
|
42
|
+
configure_logger()
|
43
|
+
logger = logging.getLogger()
|
44
|
+
try:
|
45
|
+
_log_info(f"Starting {tool_name} tool with AMP Provider.")
|
46
|
+
driver = AMPDriver()
|
47
|
+
# Could conditionally load Plugin V1 or V2 here if found necessary
|
48
|
+
plugin_class = load_plugin_class(plugins_package, tool_name)
|
49
|
+
driver._plugin_class = plugin_class
|
50
|
+
|
51
|
+
runner = SdkToolRunner(
|
52
|
+
sdk_engine_server_address # SocketAddress.from_address_str(sdk_engine_server_address)
|
53
|
+
)
|
54
|
+
try:
|
55
|
+
asyncio.get_event_loop().run_until_complete(runner.start_service())
|
56
|
+
except Exception as e:
|
57
|
+
_log_error(f"ERROR: Couldn't start service.")
|
58
|
+
logger.exception(e)
|
59
|
+
raise typer.Exit(code=1)
|
60
|
+
_log_info("Exiting process")
|
61
|
+
except Exception as e:
|
62
|
+
typer.echo(f"EXCEPTION: {e}")
|
63
|
+
logger.exception(e)
|
64
|
+
raise
|
65
|
+
|
66
|
+
|
67
|
+
def _log_info(msg: str) -> None:
|
68
|
+
logger = logging.getLogger()
|
69
|
+
logger.info("INFO: %s", msg)
|
70
|
+
typer.echo(f"INFO: {msg}")
|
71
|
+
|
72
|
+
|
73
|
+
def _log_error(msg: str) -> None:
|
74
|
+
logger = logging.getLogger()
|
75
|
+
logger.error("ERROR: %s", msg)
|
76
|
+
typer.echo(f"ERROR: {msg}")
|
77
|
+
|
78
|
+
|
79
|
+
def main() -> None:
|
80
|
+
"""Entrypoint method for the tracer bullet application."""
|
81
|
+
app()
|
82
|
+
|
83
|
+
|
84
|
+
if __name__ == "__main__":
|
85
|
+
main()
|