another-ayx-python-sdk 2.4.24__py3-none-any.whl → 2.4.25__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- another_ayx_python_sdk/version.py +3 -3
- {another_ayx_python_sdk-2.4.24.dist-info → another_ayx_python_sdk-2.4.25.dist-info}/METADATA +1 -1
- {another_ayx_python_sdk-2.4.24.dist-info → another_ayx_python_sdk-2.4.25.dist-info}/RECORD +7 -212
- {another_ayx_python_sdk-2.4.24.dist-info → another_ayx_python_sdk-2.4.25.dist-info}/top_level.txt +0 -2
- build/lib/another_ayx_python_sdk/__init__.py +0 -14
- build/lib/another_ayx_python_sdk/__main__.py +0 -470
- build/lib/another_ayx_python_sdk/assets/workspace_files/__init__.py +0 -14
- build/lib/another_ayx_python_sdk/assets/workspace_files/setup.py +0 -38
- build/lib/another_ayx_python_sdk/cli/__init__.py +0 -14
- build/lib/another_ayx_python_sdk/cli/utilities.py +0 -103
- build/lib/another_ayx_python_sdk/cli/workspace.py +0 -266
- build/lib/another_ayx_python_sdk/cli/yxi_builder.py +0 -125
- build/lib/another_ayx_python_sdk/cli/yxi_installer.py +0 -45
- build/lib/another_ayx_python_sdk/core/__init__.py +0 -51
- build/lib/another_ayx_python_sdk/core/constants.py +0 -25
- build/lib/another_ayx_python_sdk/core/dcm_base.py +0 -115
- build/lib/another_ayx_python_sdk/core/doc_utilities.py +0 -40
- build/lib/another_ayx_python_sdk/core/environment_base.py +0 -213
- build/lib/another_ayx_python_sdk/core/exceptions.py +0 -59
- build/lib/another_ayx_python_sdk/core/field.py +0 -183
- build/lib/another_ayx_python_sdk/core/input_anchor_base.py +0 -86
- build/lib/another_ayx_python_sdk/core/input_connection_base.py +0 -206
- build/lib/another_ayx_python_sdk/core/io_base.py +0 -139
- build/lib/another_ayx_python_sdk/core/metadata.py +0 -173
- build/lib/another_ayx_python_sdk/core/observable_mixin.py +0 -90
- build/lib/another_ayx_python_sdk/core/output_anchor_base.py +0 -151
- build/lib/another_ayx_python_sdk/core/plugin.py +0 -108
- build/lib/another_ayx_python_sdk/core/plugin_v2.py +0 -97
- build/lib/another_ayx_python_sdk/core/provider_base.py +0 -125
- build/lib/another_ayx_python_sdk/core/proxy_requests.py +0 -51
- build/lib/another_ayx_python_sdk/core/record_packet.py +0 -88
- build/lib/another_ayx_python_sdk/core/record_packet_base.py +0 -123
- build/lib/another_ayx_python_sdk/core/register_plugin.py +0 -127
- build/lib/another_ayx_python_sdk/core/testing.py +0 -191
- build/lib/another_ayx_python_sdk/core/utils.py +0 -146
- build/lib/another_ayx_python_sdk/examples/AyxSdkInput/main.py +0 -89
- build/lib/another_ayx_python_sdk/examples/AyxSdkMultiConnectionsMultiOutputAnchor/main.py +0 -102
- build/lib/another_ayx_python_sdk/examples/AyxSdkMultipleInputAnchors/main.py +0 -84
- build/lib/another_ayx_python_sdk/examples/AyxSdkMultipleOutputAnchors/main.py +0 -96
- build/lib/another_ayx_python_sdk/examples/AyxSdkOptionalInputAnchor/main.py +0 -94
- build/lib/another_ayx_python_sdk/examples/AyxSdkOutput/main.py +0 -78
- build/lib/another_ayx_python_sdk/examples/AyxSdkPassThrough/main.py +0 -82
- build/lib/another_ayx_python_sdk/providers/__init__.py +0 -14
- build/lib/another_ayx_python_sdk/providers/amp_provider/__init__.py +0 -41
- build/lib/another_ayx_python_sdk/providers/amp_provider/__main__.py +0 -85
- build/lib/another_ayx_python_sdk/providers/amp_provider/amp_dcm.py +0 -58
- build/lib/another_ayx_python_sdk/providers/amp_provider/amp_driver.py +0 -358
- build/lib/another_ayx_python_sdk/providers/amp_provider/amp_environment.py +0 -73
- build/lib/another_ayx_python_sdk/providers/amp_provider/amp_environment_v2.py +0 -278
- build/lib/another_ayx_python_sdk/providers/amp_provider/amp_input_anchor.py +0 -73
- build/lib/another_ayx_python_sdk/providers/amp_provider/amp_input_connection.py +0 -132
- build/lib/another_ayx_python_sdk/providers/amp_provider/amp_io.py +0 -64
- build/lib/another_ayx_python_sdk/providers/amp_provider/amp_io_components.py +0 -407
- build/lib/another_ayx_python_sdk/providers/amp_provider/amp_output_anchor.py +0 -107
- build/lib/another_ayx_python_sdk/providers/amp_provider/amp_provider.py +0 -68
- build/lib/another_ayx_python_sdk/providers/amp_provider/amp_provider_v2.py +0 -128
- build/lib/another_ayx_python_sdk/providers/amp_provider/amp_record_packet.py +0 -21
- build/lib/another_ayx_python_sdk/providers/amp_provider/builders/__init__.py +0 -32
- build/lib/another_ayx_python_sdk/providers/amp_provider/builders/input_anchor_builder.py +0 -123
- build/lib/another_ayx_python_sdk/providers/amp_provider/builders/input_connection_builder.py +0 -95
- build/lib/another_ayx_python_sdk/providers/amp_provider/builders/metadata_builder.py +0 -118
- build/lib/another_ayx_python_sdk/providers/amp_provider/builders/output_anchor_builder.py +0 -110
- build/lib/another_ayx_python_sdk/providers/amp_provider/builders/packers.py +0 -458
- build/lib/another_ayx_python_sdk/providers/amp_provider/builders/record_builder.py +0 -204
- build/lib/another_ayx_python_sdk/providers/amp_provider/builders/record_packet_builder.py +0 -133
- build/lib/another_ayx_python_sdk/providers/amp_provider/builders/tool_config_builder.py +0 -59
- build/lib/another_ayx_python_sdk/providers/amp_provider/cng_certs.py +0 -197
- build/lib/another_ayx_python_sdk/providers/amp_provider/data_transport/__init__.py +0 -18
- build/lib/another_ayx_python_sdk/providers/amp_provider/data_transport/amp_transport.py +0 -127
- build/lib/another_ayx_python_sdk/providers/amp_provider/data_transport/transport_base.py +0 -35
- build/lib/another_ayx_python_sdk/providers/amp_provider/grpc_helpers/__init__.py +0 -14
- build/lib/another_ayx_python_sdk/providers/amp_provider/grpc_helpers/control_msgs.py +0 -189
- build/lib/another_ayx_python_sdk/providers/amp_provider/grpc_helpers/dcme_msgs.py +0 -119
- build/lib/another_ayx_python_sdk/providers/amp_provider/grpc_helpers/record_transfer_msgs.py +0 -32
- build/lib/another_ayx_python_sdk/providers/amp_provider/grpc_util.py +0 -161
- build/lib/another_ayx_python_sdk/providers/amp_provider/logger_config.py +0 -63
- build/lib/another_ayx_python_sdk/providers/amp_provider/plugin_class_loader.py +0 -77
- build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/__init__.py +0 -67
- build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/dcm_repository.py +0 -252
- build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/environment_repository.py +0 -212
- build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/grpc_repository.py +0 -119
- build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/input_anchor_repository.py +0 -110
- build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/input_connection_repository.py +0 -276
- build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/input_metadata_repository.py +0 -144
- build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/input_record_packet_repository.py +0 -252
- build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/io_repository.py +0 -188
- build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/output_anchor_repository.py +0 -117
- build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/output_metadata_repository.py +0 -129
- build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/output_record_packet_repository.py +0 -170
- build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/plugin_class_repository.py +0 -55
- build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/singleton.py +0 -32
- build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/test_harness_state_repository.py +0 -172
- build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/tool_config_repository.py +0 -89
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/__init__.py +0 -14
- 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 +0 -25
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/close_outgoing_anchor_pb2_grpc.py +0 -4
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/dcm_e_pb2.py +0 -38
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/dcm_e_pb2_grpc.py +0 -4
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/incoming_anchor_pb2.py +0 -26
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/incoming_anchor_pb2_grpc.py +0 -4
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/incoming_connection_complete_pb2.py +0 -25
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/incoming_connection_complete_pb2_grpc.py +0 -4
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/incoming_connection_pb2.py +0 -26
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/incoming_connection_pb2_grpc.py +0 -4
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/incoming_data_push_pb2.py +0 -26
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/incoming_data_push_pb2_grpc.py +0 -4
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/incoming_record_packet_push_pb2.py +0 -26
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/incoming_record_packet_push_pb2_grpc.py +0 -4
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/metadata_pb2.py +0 -31
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/metadata_pb2_grpc.py +0 -4
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/outgoing_anchor_pb2.py +0 -28
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/outgoing_anchor_pb2_grpc.py +0 -4
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/outgoing_data_push_pb2.py +0 -26
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/outgoing_data_push_pb2_grpc.py +0 -4
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/outgoing_metadata_push_pb2.py +0 -26
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/outgoing_metadata_push_pb2_grpc.py +0 -4
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/outgoing_record_packet_push_pb2.py +0 -26
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/outgoing_record_packet_push_pb2_grpc.py +0 -4
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/output_message_data_pb2.py +0 -29
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/output_message_data_pb2_grpc.py +0 -4
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/password_data_pb2.py +0 -25
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/password_data_pb2_grpc.py +0 -4
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/plugin_initialization_data_pb2.py +0 -33
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/plugin_initialization_data_pb2_grpc.py +0 -4
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/record_batch_pb2.py +0 -25
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/record_batch_pb2_grpc.py +0 -4
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/record_packet_pb2.py +0 -29
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/record_packet_pb2_grpc.py +0 -4
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/sdk_engine_service_pb2.py +0 -34
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/sdk_engine_service_pb2_grpc.py +0 -305
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/sdk_tool_service_pb2.py +0 -30
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/sdk_tool_service_pb2_grpc.py +0 -235
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/sdk_tool_service_startup_info_pb2.py +0 -25
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/sdk_tool_service_startup_info_pb2_grpc.py +0 -4
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/sdk_tool_service_v2_pb2.py +0 -54
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/sdk_tool_service_v2_pb2_grpc.py +0 -99
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/translate_message_data_pb2.py +0 -27
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/translate_message_data_pb2_grpc.py +0 -4
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/transport_pb2.py +0 -31
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/transport_pb2_grpc.py +0 -4
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/update_progress_pb2.py +0 -25
- build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/update_progress_pb2_grpc.py +0 -4
- build/lib/another_ayx_python_sdk/providers/amp_provider/sdk_tool_runner.py +0 -115
- build/lib/another_ayx_python_sdk/providers/amp_provider/sdk_tool_service.py +0 -207
- build/lib/another_ayx_python_sdk/providers/amp_provider/sdk_tool_service_v2.py +0 -306
- build/lib/another_ayx_python_sdk/providers/amp_provider/utilities/__init__.py +0 -14
- build/lib/another_ayx_python_sdk/providers/amp_provider/utilities/constants.py +0 -22
- build/lib/another_ayx_python_sdk/providers/amp_provider/utilities/conversions.py +0 -55
- build/lib/another_ayx_python_sdk/providers/amp_provider/utilities/utilities.py +0 -63
- build/lib/another_ayx_python_sdk/providers/e1_provider/__init__.py +0 -36
- build/lib/another_ayx_python_sdk/providers/e1_provider/anchor_builder.py +0 -95
- build/lib/another_ayx_python_sdk/providers/e1_provider/cache_e1_sdk_import.py +0 -31
- build/lib/another_ayx_python_sdk/providers/e1_provider/connection_callback_strategy.py +0 -155
- build/lib/another_ayx_python_sdk/providers/e1_provider/connection_interface.py +0 -125
- build/lib/another_ayx_python_sdk/providers/e1_provider/e1_dcm.py +0 -53
- build/lib/another_ayx_python_sdk/providers/e1_provider/e1_environment.py +0 -127
- build/lib/another_ayx_python_sdk/providers/e1_provider/e1_input_anchor.py +0 -51
- build/lib/another_ayx_python_sdk/providers/e1_provider/e1_input_anchor_proxy.py +0 -33
- build/lib/another_ayx_python_sdk/providers/e1_provider/e1_input_connection.py +0 -87
- build/lib/another_ayx_python_sdk/providers/e1_provider/e1_io.py +0 -71
- build/lib/another_ayx_python_sdk/providers/e1_provider/e1_output_anchor.py +0 -157
- build/lib/another_ayx_python_sdk/providers/e1_provider/e1_output_anchor_proxy.py +0 -97
- build/lib/another_ayx_python_sdk/providers/e1_provider/e1_plugin_driver.py +0 -63
- build/lib/another_ayx_python_sdk/providers/e1_provider/e1_plugin_proxy.py +0 -363
- build/lib/another_ayx_python_sdk/providers/e1_provider/e1_provider.py +0 -71
- build/lib/another_ayx_python_sdk/providers/e1_provider/e1_record_packet.py +0 -21
- build/lib/another_ayx_python_sdk/providers/e1_provider/events.py +0 -36
- build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/AlteryxPythonSDK/__init__.py +0 -37
- build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/AlteryxPythonSDK/alteryx_engine.py +0 -105
- build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/AlteryxPythonSDK/constants.py +0 -50
- build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/AlteryxPythonSDK/field.py +0 -122
- build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/AlteryxPythonSDK/output_anchor.py +0 -55
- build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/AlteryxPythonSDK/output_anchor_manager.py +0 -31
- build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/AlteryxPythonSDK/record_copier.py +0 -65
- build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/AlteryxPythonSDK/record_creator.py +0 -41
- build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/AlteryxPythonSDK/record_info.py +0 -134
- build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/AlteryxPythonSDK/record_ref.py +0 -42
- build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/AlteryxPythonSDK/tool.py +0 -29
- build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/AlteryxPythonSDK/tool_execution_info.py +0 -43
- build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/__init__.py +0 -14
- build/lib/another_ayx_python_sdk/providers/e1_provider/proxies/__init__.py +0 -18
- build/lib/another_ayx_python_sdk/providers/e1_provider/proxies/field_proxy.py +0 -109
- build/lib/another_ayx_python_sdk/providers/e1_provider/proxies/record_copier_proxy.py +0 -49
- build/lib/another_ayx_python_sdk/providers/e1_provider/records/__init__.py +0 -23
- build/lib/another_ayx_python_sdk/providers/e1_provider/records/base_record_container.py +0 -47
- build/lib/another_ayx_python_sdk/providers/e1_provider/records/parsed_record_container.py +0 -67
- build/lib/another_ayx_python_sdk/providers/e1_provider/records/raw_record_container.py +0 -111
- build/lib/another_ayx_python_sdk/providers/e1_provider/tool_config_loader.py +0 -132
- build/lib/another_ayx_python_sdk/providers/e1_provider/utilities/__init__.py +0 -35
- build/lib/another_ayx_python_sdk/providers/e1_provider/utilities/utilities.py +0 -54
- build/lib/another_ayx_python_sdk/providers/e1_provider/workflow_config.py +0 -31
- build/lib/another_ayx_python_sdk/providers/file_provider/__init__.py +0 -32
- build/lib/another_ayx_python_sdk/providers/file_provider/environment.py +0 -131
- build/lib/another_ayx_python_sdk/providers/file_provider/file_adapter.py +0 -286
- build/lib/another_ayx_python_sdk/providers/file_provider/file_provider.py +0 -185
- build/lib/another_ayx_python_sdk/providers/file_provider/file_provider_dcm.py +0 -53
- build/lib/another_ayx_python_sdk/providers/file_provider/file_provider_input_anchor.py +0 -70
- build/lib/another_ayx_python_sdk/providers/file_provider/file_provider_input_connection.py +0 -112
- build/lib/another_ayx_python_sdk/providers/file_provider/file_provider_output_anchor.py +0 -114
- build/lib/another_ayx_python_sdk/providers/file_provider/file_record_packet.py +0 -21
- build/lib/another_ayx_python_sdk/providers/file_provider/iox.py +0 -56
- build/lib/another_ayx_python_sdk/providers/file_provider/tool_input.py +0 -104
- build/lib/another_ayx_python_sdk/test_harness/__init__.py +0 -14
- build/lib/another_ayx_python_sdk/test_harness/__main__.py +0 -120
- build/lib/another_ayx_python_sdk/test_harness/plugin_runner.py +0 -416
- build/lib/another_ayx_python_sdk/test_harness/process_lifecycle_manager.py +0 -80
- build/lib/another_ayx_python_sdk/test_harness/sdk_engine_service.py +0 -106
- build/lib/another_ayx_python_sdk/version.py +0 -8
- {another_ayx_python_sdk-2.4.24.dist-info → another_ayx_python_sdk-2.4.25.dist-info}/WHEEL +0 -0
- {another_ayx_python_sdk-2.4.24.dist-info → another_ayx_python_sdk-2.4.25.dist-info}/entry_points.txt +0 -0
- {another_ayx_python_sdk-2.4.24.dist-info → another_ayx_python_sdk-2.4.25.dist-info}/licenses/LICENSE +0 -0
@@ -1,70 +0,0 @@
|
|
1
|
-
# Copyright (C) 2022 Alteryx, Inc. All rights reserved.
|
2
|
-
#
|
3
|
-
# Licensed under the ALTERYX SDK AND API LICENSE AGREEMENT;
|
4
|
-
# you may not use this file except in compliance with the License.
|
5
|
-
# You may obtain a copy of the License at
|
6
|
-
#
|
7
|
-
# https://www.alteryx.com/alteryx-sdk-and-api-license-agreement
|
8
|
-
#
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
-
# See the License for the specific language governing permissions and
|
13
|
-
# limitations under the License.
|
14
|
-
"""The file provider input anchor class definition."""
|
15
|
-
from typing import List, Optional, TYPE_CHECKING
|
16
|
-
|
17
|
-
from another_ayx_python_sdk.core.doc_utilities import inherit_docs
|
18
|
-
from another_ayx_python_sdk.core.input_anchor_base import InputAnchorBase
|
19
|
-
|
20
|
-
if TYPE_CHECKING: # noqa: F401
|
21
|
-
from another_ayx_python_sdk.core.input_connection_base import ( # noqa: F401
|
22
|
-
InputConnectionBase,
|
23
|
-
) # noqa: F401
|
24
|
-
|
25
|
-
|
26
|
-
@inherit_docs
|
27
|
-
class FileProviderInputAnchor(InputAnchorBase):
|
28
|
-
"""An input anchor that contains input connection information."""
|
29
|
-
|
30
|
-
def __init__(
|
31
|
-
self,
|
32
|
-
name: str,
|
33
|
-
allow_multiple: bool = False,
|
34
|
-
optional: bool = False,
|
35
|
-
connections: Optional[List["InputConnectionBase"]] = None,
|
36
|
-
) -> None:
|
37
|
-
"""
|
38
|
-
Instantiate a file provider input anchor.
|
39
|
-
|
40
|
-
Parameters
|
41
|
-
----------
|
42
|
-
name
|
43
|
-
The name of the input anchor.
|
44
|
-
allow_multiple
|
45
|
-
Indicates whether the anchor can have multiple input connections associated with it.
|
46
|
-
optional
|
47
|
-
Indicates whether the anchor is optional or not.
|
48
|
-
connections
|
49
|
-
The list of input connections associated with this anchor.
|
50
|
-
"""
|
51
|
-
self.__name = name
|
52
|
-
self.__allow_multiple = allow_multiple
|
53
|
-
self.__optional = optional
|
54
|
-
self.__connections: List["InputConnectionBase"] = connections or []
|
55
|
-
|
56
|
-
@property
|
57
|
-
def name(self) -> str: # noqa: D102
|
58
|
-
return self.__name
|
59
|
-
|
60
|
-
@property
|
61
|
-
def allow_multiple(self) -> bool: # noqa: D102
|
62
|
-
return self.__allow_multiple
|
63
|
-
|
64
|
-
@property
|
65
|
-
def optional(self) -> bool: # noqa: D102
|
66
|
-
return self.__optional
|
67
|
-
|
68
|
-
@property
|
69
|
-
def connections(self) -> List["InputConnectionBase"]: # noqa: D102
|
70
|
-
return self.__connections
|
@@ -1,112 +0,0 @@
|
|
1
|
-
# Copyright (C) 2022 Alteryx, Inc. All rights reserved.
|
2
|
-
#
|
3
|
-
# Licensed under the ALTERYX SDK AND API LICENSE AGREEMENT;
|
4
|
-
# you may not use this file except in compliance with the License.
|
5
|
-
# You may obtain a copy of the License at
|
6
|
-
#
|
7
|
-
# https://www.alteryx.com/alteryx-sdk-and-api-license-agreement
|
8
|
-
#
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
-
# See the License for the specific language governing permissions and
|
13
|
-
# limitations under the License.
|
14
|
-
"""File Provider Input Connection class."""
|
15
|
-
from typing import Optional, TYPE_CHECKING
|
16
|
-
|
17
|
-
from another_ayx_python_sdk.core.doc_utilities import inherit_docs
|
18
|
-
from another_ayx_python_sdk.core.input_connection_base import InputConnectionBase
|
19
|
-
from another_ayx_python_sdk.core.metadata import Metadata
|
20
|
-
from another_ayx_python_sdk.core.record_packet import RecordPacket
|
21
|
-
|
22
|
-
import pandas as pd
|
23
|
-
|
24
|
-
|
25
|
-
if TYPE_CHECKING:
|
26
|
-
from another_ayx_python_sdk.providers.file_provider.file_provider_input_anchor import (
|
27
|
-
FileProviderInputAnchor,
|
28
|
-
)
|
29
|
-
|
30
|
-
|
31
|
-
@inherit_docs
|
32
|
-
class FileProviderInputConnection(InputConnectionBase):
|
33
|
-
"""An input connection contains incoming record and metadata information."""
|
34
|
-
|
35
|
-
def __init__(
|
36
|
-
self,
|
37
|
-
name: str,
|
38
|
-
metadata: Metadata,
|
39
|
-
packet: Optional[RecordPacket] = None,
|
40
|
-
anchor: Optional["FileProviderInputAnchor"] = None,
|
41
|
-
) -> None:
|
42
|
-
"""
|
43
|
-
Instantiate a file provider input connection.
|
44
|
-
|
45
|
-
Parameters
|
46
|
-
----------
|
47
|
-
name
|
48
|
-
Name of the input connection.
|
49
|
-
metadata
|
50
|
-
Metadata for the input connections.
|
51
|
-
packet
|
52
|
-
Record information for the input connection.
|
53
|
-
anchor
|
54
|
-
Input anchor associated with this connection.
|
55
|
-
"""
|
56
|
-
if packet and packet.metadata != metadata:
|
57
|
-
raise ValueError(
|
58
|
-
"Record packet metadata must be the same as anchor metadata."
|
59
|
-
)
|
60
|
-
|
61
|
-
self.__packet = packet
|
62
|
-
self.__name = name
|
63
|
-
self.__metadata = metadata
|
64
|
-
self.__anchor = anchor
|
65
|
-
self.max_packet_size = None
|
66
|
-
self.progress = 0
|
67
|
-
|
68
|
-
@property
|
69
|
-
def name(self) -> str: # noqa: D102
|
70
|
-
return self.__name
|
71
|
-
|
72
|
-
@property
|
73
|
-
def metadata(self) -> Optional[Metadata]: # noqa: D102
|
74
|
-
return self.__metadata
|
75
|
-
|
76
|
-
@property
|
77
|
-
def anchor(self) -> "FileProviderInputAnchor": # noqa: D102
|
78
|
-
if self.__anchor:
|
79
|
-
return self.__anchor
|
80
|
-
|
81
|
-
raise RuntimeError("This input connection is not associated with an anchor.")
|
82
|
-
|
83
|
-
def read(self) -> RecordPacket: # noqa: D102
|
84
|
-
if self.metadata is None:
|
85
|
-
raise ValueError("Metadata must be set.")
|
86
|
-
|
87
|
-
return self.__packet or RecordPacket(
|
88
|
-
self.metadata, pd.DataFrame(columns=[field.name for field in self.metadata])
|
89
|
-
)
|
90
|
-
|
91
|
-
def _get_max_packet_size(self) -> Optional[int]:
|
92
|
-
return self.__max_packet_size
|
93
|
-
|
94
|
-
def _set_max_packet_size(self, value: Optional[int]) -> None:
|
95
|
-
"""
|
96
|
-
File provider doesn't use max_packet size - automatically set to None.
|
97
|
-
|
98
|
-
Otherwise, a user could try and set max packet size for the file provider and would not know why it was not affecting their tool.
|
99
|
-
"""
|
100
|
-
if value is not None:
|
101
|
-
return # TODO: warn user that the file provider does not currently support setting max_packet_size
|
102
|
-
self.__max_packet_size = value
|
103
|
-
|
104
|
-
@property
|
105
|
-
def progress(self) -> float: # noqa: D102
|
106
|
-
return self.__progress
|
107
|
-
|
108
|
-
@progress.setter
|
109
|
-
def progress(self, value: float) -> None: # noqa: D102
|
110
|
-
if value < 0:
|
111
|
-
raise ValueError("Progress percentage must be greater than 0.")
|
112
|
-
self.__progress = value
|
@@ -1,114 +0,0 @@
|
|
1
|
-
# Copyright (C) 2022 Alteryx, Inc. All rights reserved.
|
2
|
-
#
|
3
|
-
# Licensed under the ALTERYX SDK AND API LICENSE AGREEMENT;
|
4
|
-
# you may not use this file except in compliance with the License.
|
5
|
-
# You may obtain a copy of the License at
|
6
|
-
#
|
7
|
-
# https://www.alteryx.com/alteryx-sdk-and-api-license-agreement
|
8
|
-
#
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
-
# See the License for the specific language governing permissions and
|
13
|
-
# limitations under the License.
|
14
|
-
"""File provider output anchor class."""
|
15
|
-
from pathlib import Path
|
16
|
-
from typing import Optional, TYPE_CHECKING
|
17
|
-
|
18
|
-
from another_ayx_python_sdk.core import OutputAnchorBase
|
19
|
-
from another_ayx_python_sdk.core.doc_utilities import inherit_docs
|
20
|
-
|
21
|
-
if TYPE_CHECKING:
|
22
|
-
from another_ayx_python_sdk.core.metadata import Metadata
|
23
|
-
from another_ayx_python_sdk.core.record_packet import RecordPacketBase
|
24
|
-
from another_ayx_python_sdk.providers.file_provider.file_adapter import ( # noqa: F401
|
25
|
-
FileAdapter,
|
26
|
-
) # noqa: F401
|
27
|
-
|
28
|
-
|
29
|
-
@inherit_docs
|
30
|
-
class FileProviderOutputAnchor(OutputAnchorBase):
|
31
|
-
"""The output anchor contains outgoing record and metadata information."""
|
32
|
-
|
33
|
-
def __init__(
|
34
|
-
self, name: str, allow_multiple: bool = False, optional: bool = False
|
35
|
-
) -> None:
|
36
|
-
"""
|
37
|
-
Instantiate a file provider output anchor.
|
38
|
-
|
39
|
-
Parameters
|
40
|
-
----------
|
41
|
-
name
|
42
|
-
Name of the output anchor.
|
43
|
-
allow_multiple
|
44
|
-
Indicates whether to allow more than one connection.
|
45
|
-
optional
|
46
|
-
Indicates whether the anchor is optional or not.
|
47
|
-
"""
|
48
|
-
self.__name = name
|
49
|
-
self.__allow_multiple = allow_multiple
|
50
|
-
self.__optional = optional
|
51
|
-
self.__metadata: Optional["Metadata"] = None
|
52
|
-
self.__is_closed: bool = True
|
53
|
-
self.__num_connections: int = 0
|
54
|
-
# TODO the file paths and FileAdapter should be populated by the constructor
|
55
|
-
self.metadata_file: Path = Path()
|
56
|
-
self.record_file: Path = Path()
|
57
|
-
self.file_adapter: Optional["FileAdapter"] = None
|
58
|
-
|
59
|
-
def update_progress(self, percentage: float) -> None:
|
60
|
-
"""File provider does not need to update progress, so pass."""
|
61
|
-
|
62
|
-
@property
|
63
|
-
def name(self) -> str: # noqa: D102
|
64
|
-
return self.__name
|
65
|
-
|
66
|
-
@property
|
67
|
-
def allow_multiple(self) -> bool: # noqa: D102
|
68
|
-
return self.__allow_multiple
|
69
|
-
|
70
|
-
@property
|
71
|
-
def optional(self) -> bool: # noqa: D102
|
72
|
-
return self.__optional
|
73
|
-
|
74
|
-
@property
|
75
|
-
def num_connections(self) -> int: # noqa: D102
|
76
|
-
return self.__num_connections
|
77
|
-
|
78
|
-
@property
|
79
|
-
def is_open(self) -> bool: # noqa: D102
|
80
|
-
return not self.__is_closed
|
81
|
-
|
82
|
-
@property
|
83
|
-
def metadata(self) -> Optional["Metadata"]: # noqa: D102
|
84
|
-
return self.__metadata
|
85
|
-
|
86
|
-
def open(self, metadata: "Metadata") -> None: # noqa: D102
|
87
|
-
if not self.file_adapter:
|
88
|
-
raise RuntimeError("File adapter must be set to open the output anchor.")
|
89
|
-
|
90
|
-
self.__metadata = metadata
|
91
|
-
# TODO we should just have a helper function here
|
92
|
-
self.file_adapter.metadata_to_xml(self.metadata_file, self.__metadata)
|
93
|
-
self.__is_closed = False
|
94
|
-
|
95
|
-
def write(self, record_packet: "RecordPacketBase") -> None: # noqa: D102
|
96
|
-
if not self.__metadata or not self.file_adapter:
|
97
|
-
raise RuntimeError(
|
98
|
-
"Output anchor must be opened before it can be written to."
|
99
|
-
)
|
100
|
-
|
101
|
-
if self.__metadata != record_packet.metadata:
|
102
|
-
raise RuntimeError(
|
103
|
-
"Output anchor's metadata must match the incoming record packet's metadata."
|
104
|
-
)
|
105
|
-
|
106
|
-
dataframe = record_packet.to_dataframe()
|
107
|
-
# TODO This will overwrite the entire CSV file. It should have the option to append the records to one that already exists.
|
108
|
-
self.file_adapter.dataframe_to_csv(self.record_file, dataframe)
|
109
|
-
|
110
|
-
def flush(self) -> None:
|
111
|
-
"""File provider does not need to flush records, so pass."""
|
112
|
-
|
113
|
-
def close(self) -> None: # noqa: D102
|
114
|
-
self.__is_closed = True
|
@@ -1,21 +0,0 @@
|
|
1
|
-
# Copyright (C) 2022 Alteryx, Inc. All rights reserved.
|
2
|
-
#
|
3
|
-
# Licensed under the ALTERYX SDK AND API LICENSE AGREEMENT;
|
4
|
-
# you may not use this file except in compliance with the License.
|
5
|
-
# You may obtain a copy of the License at
|
6
|
-
#
|
7
|
-
# https://www.alteryx.com/alteryx-sdk-and-api-license-agreement
|
8
|
-
#
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
-
# See the License for the specific language governing permissions and
|
13
|
-
# limitations under the License.
|
14
|
-
"""Interface for working with multiple records."""
|
15
|
-
from another_ayx_python_sdk.core.doc_utilities import inherit_docs
|
16
|
-
from another_ayx_python_sdk.core.record_packet import RecordPacket
|
17
|
-
|
18
|
-
|
19
|
-
@inherit_docs
|
20
|
-
class FileRecordPacket(RecordPacket):
|
21
|
-
"""File Record packet."""
|
@@ -1,56 +0,0 @@
|
|
1
|
-
# Copyright (C) 2022 Alteryx, Inc. All rights reserved.
|
2
|
-
#
|
3
|
-
# Licensed under the ALTERYX SDK AND API LICENSE AGREEMENT;
|
4
|
-
# you may not use this file except in compliance with the License.
|
5
|
-
# You may obtain a copy of the License at
|
6
|
-
#
|
7
|
-
# https://www.alteryx.com/alteryx-sdk-and-api-license-agreement
|
8
|
-
#
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
-
# See the License for the specific language governing permissions and
|
13
|
-
# limitations under the License.
|
14
|
-
"""File Provider."""
|
15
|
-
from pathlib import Path
|
16
|
-
from typing import Any
|
17
|
-
|
18
|
-
from another_ayx_python_sdk.core.io_base import IoBase
|
19
|
-
|
20
|
-
import deprecation
|
21
|
-
|
22
|
-
|
23
|
-
class IO(IoBase):
|
24
|
-
"""Simple tool interface that will be used with Designer."""
|
25
|
-
|
26
|
-
def __init__(self) -> None:
|
27
|
-
"""Instantiate the interface."""
|
28
|
-
|
29
|
-
def error(self, error_msg: str) -> None:
|
30
|
-
"""Display an error in the Results window."""
|
31
|
-
|
32
|
-
def warn(self, warn_msg: str) -> None:
|
33
|
-
"""Display a warning in the Results window."""
|
34
|
-
|
35
|
-
def info(self, info_msg: str) -> None:
|
36
|
-
"""Display information in the Results window."""
|
37
|
-
|
38
|
-
def translate_msg(self, msg: str, *args: Any) -> str:
|
39
|
-
"""Translate a message."""
|
40
|
-
raise NotImplementedError()
|
41
|
-
|
42
|
-
def update_progress(self, percent: float) -> None:
|
43
|
-
"""Update tool progress."""
|
44
|
-
|
45
|
-
def create_temp_file(self, extension: str = "tmp", options: int = 0) -> Path:
|
46
|
-
"""Create a temporary file path."""
|
47
|
-
return Path(extension)
|
48
|
-
|
49
|
-
@deprecation.deprecated(
|
50
|
-
deprecated_in="1.0.3",
|
51
|
-
removed_in="2.0.0",
|
52
|
-
details="Use functions of provider's dcm property instead",
|
53
|
-
) # type: ignore
|
54
|
-
def decrypt_password(self, password: str) -> str: # noqa: D102
|
55
|
-
"""Decrypt a password; will append '_decrypted' to the supplied password."""
|
56
|
-
return password + "_decrypted"
|
@@ -1,104 +0,0 @@
|
|
1
|
-
# Copyright (C) 2022 Alteryx, Inc. All rights reserved.
|
2
|
-
#
|
3
|
-
# Licensed under the ALTERYX SDK AND API LICENSE AGREEMENT;
|
4
|
-
# you may not use this file except in compliance with the License.
|
5
|
-
# You may obtain a copy of the License at
|
6
|
-
#
|
7
|
-
# https://www.alteryx.com/alteryx-sdk-and-api-license-agreement
|
8
|
-
#
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
-
# See the License for the specific language governing permissions and
|
13
|
-
# limitations under the License.
|
14
|
-
"""Alteryx Designer environment information."""
|
15
|
-
from pathlib import Path
|
16
|
-
from typing import List, Optional
|
17
|
-
|
18
|
-
from pydantic import BaseModel, validator
|
19
|
-
|
20
|
-
|
21
|
-
class ToolDefinition(BaseModel):
|
22
|
-
"""
|
23
|
-
ToolDefinition validates the tool information for the tool input.
|
24
|
-
|
25
|
-
Parameters
|
26
|
-
----------
|
27
|
-
plugin
|
28
|
-
The class name of the plugin being run.
|
29
|
-
path
|
30
|
-
The path to the plugin being run.
|
31
|
-
"""
|
32
|
-
|
33
|
-
plugin: str
|
34
|
-
path: Path
|
35
|
-
|
36
|
-
|
37
|
-
class AnchorDefinition(BaseModel):
|
38
|
-
"""
|
39
|
-
AnchorDefinition validates the anchor information for the tool input.
|
40
|
-
|
41
|
-
Parameters
|
42
|
-
----------
|
43
|
-
anchor_name
|
44
|
-
The name of the anchor that the records and metadata are assoiciated with.
|
45
|
-
records
|
46
|
-
The anchor record data.
|
47
|
-
metadata
|
48
|
-
The anchor metadata information.
|
49
|
-
"""
|
50
|
-
|
51
|
-
anchor_name: str
|
52
|
-
records: Path
|
53
|
-
metadata: Path
|
54
|
-
|
55
|
-
|
56
|
-
class ToolInput(BaseModel):
|
57
|
-
"""
|
58
|
-
ToolInput validates the input JSON for the user input to the file provider.
|
59
|
-
|
60
|
-
Parameters
|
61
|
-
----------
|
62
|
-
tool
|
63
|
-
A ToolDefinition object with 2 inputs, path and plugin, that contain the path
|
64
|
-
to the plugin and the plugin name respectively.
|
65
|
-
tool_config
|
66
|
-
The path to the tool configuration file.
|
67
|
-
workflow_config
|
68
|
-
The path to the workflow configuration file.
|
69
|
-
inputs
|
70
|
-
A list of AnchorDefinition objects with 3 inputs, anchor_name, records, and metadata,
|
71
|
-
that specify the anchor the input information corresponds to, the record information for that anchor,
|
72
|
-
and the metadata information for that anchor respectively.
|
73
|
-
outputs
|
74
|
-
A list of AnchorDefinition objects with 3 inputs, anchor_name, records, and metadata, that specify the anchor
|
75
|
-
the output information corresponds to, the file where the record information for that anchor will
|
76
|
-
be stored, and the file where the metadata information for that anchor will be stored respectively.
|
77
|
-
update_tool_config
|
78
|
-
An optional path that indicates whether to update the tool's config. If it is set,
|
79
|
-
the config will be updated at the specified path.
|
80
|
-
"""
|
81
|
-
|
82
|
-
tool: ToolDefinition
|
83
|
-
tool_config: Path
|
84
|
-
workflow_config: Path
|
85
|
-
inputs: Optional[List[AnchorDefinition]]
|
86
|
-
outputs: Optional[List[AnchorDefinition]]
|
87
|
-
update_tool_config: Optional[Path]
|
88
|
-
|
89
|
-
@validator("inputs", "outputs", always=True, pre=True)
|
90
|
-
def anchor_is_none(cls, v): # type: ignore # noqa: N805
|
91
|
-
"""
|
92
|
-
Set the inputs and outputs equal to an empty list if they aren't specified.
|
93
|
-
|
94
|
-
Parameters
|
95
|
-
----------
|
96
|
-
v
|
97
|
-
The inputs or the outputs optional list of dictionaries.
|
98
|
-
|
99
|
-
Returns
|
100
|
-
-------
|
101
|
-
List[Dict[str, str]]
|
102
|
-
An empty list or the inputs or outputs.
|
103
|
-
"""
|
104
|
-
return v or []
|
@@ -1,14 +0,0 @@
|
|
1
|
-
# Copyright (C) 2022 Alteryx, Inc. All rights reserved.
|
2
|
-
#
|
3
|
-
# Licensed under the ALTERYX SDK AND API LICENSE AGREEMENT;
|
4
|
-
# you may not use this file except in compliance with the License.
|
5
|
-
# You may obtain a copy of the License at
|
6
|
-
#
|
7
|
-
# https://www.alteryx.com/alteryx-sdk-and-api-license-agreement
|
8
|
-
#
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
-
# See the License for the specific language governing permissions and
|
13
|
-
# limitations under the License.
|
14
|
-
"""Python SDK gRPC Plugin Test harness."""
|
@@ -1,120 +0,0 @@
|
|
1
|
-
# Copyright (C) 2022 Alteryx, Inc. All rights reserved.
|
2
|
-
#
|
3
|
-
# Licensed under the ALTERYX SDK AND API LICENSE AGREEMENT;
|
4
|
-
# you may not use this file except in compliance with the License.
|
5
|
-
# You may obtain a copy of the License at
|
6
|
-
#
|
7
|
-
# https://www.alteryx.com/alteryx-sdk-and-api-license-agreement
|
8
|
-
#
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
-
# See the License for the specific language governing permissions and
|
13
|
-
# limitations under the License.
|
14
|
-
"""Entrypoint for the test harness."""
|
15
|
-
import asyncio
|
16
|
-
from enum import Enum
|
17
|
-
from pathlib import Path
|
18
|
-
from typing import List
|
19
|
-
|
20
|
-
from another_ayx_python_sdk.core import Field, FieldType, Metadata
|
21
|
-
from another_ayx_python_sdk.test_harness.plugin_runner import (
|
22
|
-
PluginRunner,
|
23
|
-
RunMode,
|
24
|
-
)
|
25
|
-
|
26
|
-
import pandas as pd
|
27
|
-
|
28
|
-
import typer
|
29
|
-
|
30
|
-
pd.set_option("display.max_columns", None)
|
31
|
-
|
32
|
-
app = typer.Typer()
|
33
|
-
|
34
|
-
|
35
|
-
class TransportType(Enum):
|
36
|
-
"""Data serialization formats."""
|
37
|
-
|
38
|
-
ENGINE = "engine"
|
39
|
-
ARROW = "arrow"
|
40
|
-
|
41
|
-
|
42
|
-
@app.command()
|
43
|
-
def version() -> None:
|
44
|
-
"""Get the version pf the test harness."""
|
45
|
-
typer.echo("Version: 1.0.0")
|
46
|
-
|
47
|
-
|
48
|
-
@app.command()
|
49
|
-
def run_plugin(
|
50
|
-
plugin_entrypoint: Path = typer.Argument(
|
51
|
-
..., help="The path to the entrypoint to run."
|
52
|
-
),
|
53
|
-
plugins_package: str = typer.Argument(
|
54
|
-
..., help="The package that contains plugins to run."
|
55
|
-
),
|
56
|
-
tool_name: str = typer.Argument(..., help="The name of the tool to run."),
|
57
|
-
config_xml: Path = typer.Argument(
|
58
|
-
..., help="Config XML file containing input/output anchor config."
|
59
|
-
),
|
60
|
-
input_csv: List[Path] = typer.Option(
|
61
|
-
"", help="List of CSV files to use as input data."
|
62
|
-
),
|
63
|
-
transport_type: str = typer.Option(
|
64
|
-
TransportType.ARROW, help="[engine | arrow] which data type to use for the run"
|
65
|
-
),
|
66
|
-
run_mode: RunMode = RunMode.full_run,
|
67
|
-
) -> None:
|
68
|
-
"""Run a plugin out of process and run data through it."""
|
69
|
-
typer.echo(
|
70
|
-
f"Running {tool_name} in {'update only' if run_mode == RunMode.update_only else 'full run'} mode.\n"
|
71
|
-
)
|
72
|
-
input_data = []
|
73
|
-
if input_csv:
|
74
|
-
for path in input_csv:
|
75
|
-
if not path.is_file() or not path.exists():
|
76
|
-
raise FileNotFoundError("Could not find input csv data")
|
77
|
-
dataframe = pd.read_csv(path)
|
78
|
-
input_data.append(dataframe)
|
79
|
-
|
80
|
-
input_metadata = [_get_metadata(df) for df in input_data]
|
81
|
-
|
82
|
-
runner = PluginRunner(
|
83
|
-
plugin_entrypoint,
|
84
|
-
plugins_package,
|
85
|
-
tool_name,
|
86
|
-
input_metadata,
|
87
|
-
input_data,
|
88
|
-
config_xml,
|
89
|
-
transport_type,
|
90
|
-
)
|
91
|
-
asyncio.run(runner.run_plugin_v2(run_mode))
|
92
|
-
|
93
|
-
# Keeping the below as a reminder in case we need to test metadata still.
|
94
|
-
# if transport_type == "engine":
|
95
|
-
# output_metadata = runner.get_output_metadata()
|
96
|
-
# typer.echo(f"Output metadata is:\n{output_metadata}\n")
|
97
|
-
|
98
|
-
# if run_mode == RunMode.full_run:
|
99
|
-
# output_data = runner.get_output_data()
|
100
|
-
# typer.echo(f"Output data is:\n{output_data}\n")
|
101
|
-
|
102
|
-
|
103
|
-
def _get_metadata(dataframe: pd.DataFrame) -> Metadata:
|
104
|
-
fields = []
|
105
|
-
for col in dataframe.columns:
|
106
|
-
name, field_type, size = col.split("-")
|
107
|
-
fields.append(
|
108
|
-
Field(name=name, field_type=FieldType(field_type), size=int(size))
|
109
|
-
)
|
110
|
-
|
111
|
-
return Metadata(fields)
|
112
|
-
|
113
|
-
|
114
|
-
def main() -> None:
|
115
|
-
"""Run the main CLI for the test harness."""
|
116
|
-
app()
|
117
|
-
|
118
|
-
|
119
|
-
if __name__ == "__main__":
|
120
|
-
main()
|