another-ayx-python-sdk 2.4.24__py3-none-any.whl → 2.5.0__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/__main__.py +2 -2
- another_ayx_python_sdk/examples/AyxSdkInput/main.py +1 -1
- another_ayx_python_sdk/examples/requirements.txt +1 -1
- another_ayx_python_sdk/version.py +3 -3
- another_ayx_python_sdk-2.5.0.dist-info/METADATA +151 -0
- {another_ayx_python_sdk-2.4.24.dist-info → another_ayx_python_sdk-2.5.0.dist-info}/RECORD +10 -215
- {another_ayx_python_sdk-2.4.24.dist-info → another_ayx_python_sdk-2.5.0.dist-info}/WHEEL +1 -1
- {another_ayx_python_sdk-2.4.24.dist-info → another_ayx_python_sdk-2.5.0.dist-info}/top_level.txt +0 -2
- another_ayx_python_sdk-2.4.24.dist-info/METADATA +0 -63
- 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.5.0.dist-info}/entry_points.txt +0 -0
- {another_ayx_python_sdk-2.4.24.dist-info → another_ayx_python_sdk-2.5.0.dist-info}/licenses/LICENSE +0 -0
@@ -1,32 +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 Python SDK - File Adapter for standalone testing."""
|
15
|
-
|
16
|
-
from .file_adapter import FileAdapter
|
17
|
-
from .file_provider import FileProvider
|
18
|
-
from .file_provider_input_anchor import FileProviderInputAnchor
|
19
|
-
from .file_provider_input_connection import FileProviderInputConnection
|
20
|
-
from .file_provider_output_anchor import FileProviderOutputAnchor
|
21
|
-
from .tool_input import AnchorDefinition, ToolDefinition, ToolInput
|
22
|
-
|
23
|
-
__all__ = [
|
24
|
-
"AnchorDefinition",
|
25
|
-
"FileAdapter",
|
26
|
-
"FileProvider",
|
27
|
-
"FileProviderInputAnchor",
|
28
|
-
"FileProviderInputConnection",
|
29
|
-
"FileProviderOutputAnchor",
|
30
|
-
"ToolDefinition",
|
31
|
-
"ToolInput",
|
32
|
-
]
|
@@ -1,131 +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 runtime environment information."""
|
15
|
-
import os
|
16
|
-
from pathlib import Path
|
17
|
-
from typing import Optional
|
18
|
-
|
19
|
-
from another_ayx_python_sdk.core.doc_utilities import inherit_docs
|
20
|
-
from another_ayx_python_sdk.core.environment_base import (
|
21
|
-
EnvironmentBase,
|
22
|
-
Locale,
|
23
|
-
UpdateMode,
|
24
|
-
)
|
25
|
-
|
26
|
-
import xmltodict
|
27
|
-
|
28
|
-
|
29
|
-
@inherit_docs
|
30
|
-
class Environment(EnvironmentBase):
|
31
|
-
"""Environment information for the file provider."""
|
32
|
-
|
33
|
-
def __init__(self, update_config_path: Optional[Path] = None) -> None:
|
34
|
-
"""
|
35
|
-
Instantiate the file provider environment information.
|
36
|
-
|
37
|
-
Parameters
|
38
|
-
----------
|
39
|
-
update_config_path
|
40
|
-
The path to use if the tool config file should be updated.
|
41
|
-
"""
|
42
|
-
self.__update_config_path = update_config_path
|
43
|
-
|
44
|
-
@property
|
45
|
-
def update_only(self) -> bool:
|
46
|
-
"""
|
47
|
-
Check if the file provider is running in update-only mode.
|
48
|
-
|
49
|
-
Returns
|
50
|
-
-------
|
51
|
-
bool
|
52
|
-
False in the file provider because update-only mode is not implemented.
|
53
|
-
"""
|
54
|
-
# TODO change this when update only mode gets implemented
|
55
|
-
return False
|
56
|
-
|
57
|
-
@property
|
58
|
-
def update_mode(self) -> UpdateMode:
|
59
|
-
"""
|
60
|
-
Return NO_UPDATE_MODE because update-only mode is not implemented in the file provider.
|
61
|
-
|
62
|
-
Returns
|
63
|
-
-------
|
64
|
-
UpdateMode
|
65
|
-
Returns NO_UPDATE_MODE.
|
66
|
-
"""
|
67
|
-
# TODO change this when update only mode gets implemented
|
68
|
-
return UpdateMode.NO_UPDATE_MODE
|
69
|
-
|
70
|
-
@property
|
71
|
-
def designer_version(self) -> str:
|
72
|
-
"""
|
73
|
-
Return 0.0.0.0 because Designer is not being used.
|
74
|
-
|
75
|
-
Returns
|
76
|
-
-------
|
77
|
-
str
|
78
|
-
0.0.0.0
|
79
|
-
"""
|
80
|
-
return "0.0.0.0"
|
81
|
-
|
82
|
-
@property
|
83
|
-
def workflow_dir(self) -> Path: # noqa: D102
|
84
|
-
return Path(os.getcwd())
|
85
|
-
|
86
|
-
@property
|
87
|
-
def workflow_id(self) -> str: # noqa: D102
|
88
|
-
return ""
|
89
|
-
|
90
|
-
def parse_settings_key_value(
|
91
|
-
self, settings_str: str, line_delimiter: str = "\n", key_delimiter: str = "="
|
92
|
-
) -> dict: # noqa: D102
|
93
|
-
return super().parse_settings_key_value(
|
94
|
-
settings_str, line_delimiter=line_delimiter, key_delimiter=key_delimiter
|
95
|
-
)
|
96
|
-
|
97
|
-
def get_settings_conf(
|
98
|
-
self, keys: list, version_override: str = ""
|
99
|
-
) -> dict: # noqa: D102
|
100
|
-
"""Parse xml to retrieve settings for a given designer version."""
|
101
|
-
return super().get_settings_conf(keys, version_override)
|
102
|
-
|
103
|
-
@property
|
104
|
-
def proxy_configuration(self) -> dict: # noqa: D102
|
105
|
-
"""Retrieve proxy config from UserSettings.xml."""
|
106
|
-
keys = ["AlteryxSettings", "GloablSettings", "ProxyConfiguration"]
|
107
|
-
return self.get_settings_conf(keys)
|
108
|
-
|
109
|
-
@property
|
110
|
-
def alteryx_install_dir(self) -> Path:
|
111
|
-
"""File provider does not use Designer, so this should raise NotImplementedError."""
|
112
|
-
raise NotImplementedError()
|
113
|
-
|
114
|
-
@property
|
115
|
-
def alteryx_locale(self) -> Locale:
|
116
|
-
"""File provider does not use Designer, so automatically return English."""
|
117
|
-
return "en"
|
118
|
-
|
119
|
-
@property
|
120
|
-
def tool_id(self) -> int: # noqa: D102
|
121
|
-
return -1
|
122
|
-
|
123
|
-
def update_tool_config(self, new_config: dict) -> None: # noqa: D102
|
124
|
-
if self.__update_config_path:
|
125
|
-
xml = xmltodict.unparse(
|
126
|
-
input_dict={"Configuration": new_config},
|
127
|
-
pretty=True,
|
128
|
-
short_empty_elements=True,
|
129
|
-
)
|
130
|
-
with open(self.__update_config_path, "w") as fd:
|
131
|
-
fd.write(xml + "\n")
|
@@ -1,286 +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
|
-
"""Converts file provider classes to and from XML and CSV files."""
|
15
|
-
from pathlib import Path
|
16
|
-
from typing import Any, Dict, List, Set
|
17
|
-
from xml.parsers.expat import ExpatError
|
18
|
-
|
19
|
-
from another_ayx_python_sdk.core.field import FieldType
|
20
|
-
from another_ayx_python_sdk.core.metadata import Metadata
|
21
|
-
from another_ayx_python_sdk.providers.file_provider.file_provider_input_anchor import (
|
22
|
-
FileProviderInputAnchor,
|
23
|
-
)
|
24
|
-
from another_ayx_python_sdk.providers.file_provider.file_provider_output_anchor import (
|
25
|
-
FileProviderOutputAnchor,
|
26
|
-
)
|
27
|
-
|
28
|
-
import pandas as pd
|
29
|
-
|
30
|
-
import xmltodict
|
31
|
-
|
32
|
-
|
33
|
-
class FileAdapter:
|
34
|
-
"""
|
35
|
-
File adapter class definition.
|
36
|
-
|
37
|
-
This class converts input files into file provider objects and
|
38
|
-
then also converts file provider objects back into output files.
|
39
|
-
"""
|
40
|
-
|
41
|
-
def __init__(self, tool_config: Path, workflow_config: Path):
|
42
|
-
"""
|
43
|
-
Instantiate a file adapter.
|
44
|
-
|
45
|
-
Parameters
|
46
|
-
----------
|
47
|
-
tool_config
|
48
|
-
The path to the XML file that contains the tool configuration.
|
49
|
-
workflow_config
|
50
|
-
The path to the XML file that contains the anchor configurations.
|
51
|
-
"""
|
52
|
-
config = self.convert_to_dict(tool_config)
|
53
|
-
self.tool_config: Dict[str, Any] = config["Configuration"]
|
54
|
-
self.workflow_config = self.convert_to_dict(workflow_config)
|
55
|
-
tool_info = self.workflow_config["AlteryxJavaScriptPlugin"]["Properties"][
|
56
|
-
"MetaInfo"
|
57
|
-
]
|
58
|
-
self.name = tool_info["Name"]
|
59
|
-
self.description = tool_info["Description"]
|
60
|
-
self.use_append: Set = set()
|
61
|
-
|
62
|
-
def convert_to_dict(self, xml_file: Path) -> Dict[str, Any]:
|
63
|
-
"""
|
64
|
-
Convert a XML file to a Python dictionary.
|
65
|
-
|
66
|
-
Parameters
|
67
|
-
----------
|
68
|
-
xml_file
|
69
|
-
The XML file that should be converted to a Python dictionary.
|
70
|
-
|
71
|
-
Returns
|
72
|
-
-------
|
73
|
-
Dict[str, Any]
|
74
|
-
The anchor configuration information.
|
75
|
-
"""
|
76
|
-
try:
|
77
|
-
with open(xml_file) as fd:
|
78
|
-
return dict(xmltodict.parse(fd.read(), strip_whitespace=True))
|
79
|
-
except ExpatError:
|
80
|
-
raise RuntimeError(
|
81
|
-
f"Error while parsing file {xml_file}, make sure that this file is well-formed"
|
82
|
-
)
|
83
|
-
|
84
|
-
def csv_to_dataframe(self, input_file: Path) -> pd.DataFrame:
|
85
|
-
"""
|
86
|
-
Convert a CSV file to a pandas dataframe.
|
87
|
-
|
88
|
-
Parameters
|
89
|
-
----------
|
90
|
-
input_file
|
91
|
-
The input CSV file that should be converted to a pandas dataframe.
|
92
|
-
|
93
|
-
Returns
|
94
|
-
-------
|
95
|
-
pandas.Dataframe
|
96
|
-
The pandas dataframe that contains the input records.
|
97
|
-
"""
|
98
|
-
return pd.read_csv(input_file)
|
99
|
-
|
100
|
-
def xml_to_metadata(self, xml_file: Path) -> Metadata:
|
101
|
-
"""
|
102
|
-
Convert an XML file to record metadata.
|
103
|
-
|
104
|
-
Parameters
|
105
|
-
----------
|
106
|
-
xml_file
|
107
|
-
The XML file that should be converted to Metadata.
|
108
|
-
|
109
|
-
Returns
|
110
|
-
-------
|
111
|
-
Metadata
|
112
|
-
The metadata information from the incoming XML file.
|
113
|
-
"""
|
114
|
-
try:
|
115
|
-
metadata = Metadata()
|
116
|
-
metadata_dict = self.convert_to_dict(xml_file)
|
117
|
-
# Iterate through each element of the XML called "Field"
|
118
|
-
fields = metadata_dict["RecordInfo"]["Field"]
|
119
|
-
for field in fields:
|
120
|
-
name = field["@name"] # required
|
121
|
-
field_type = FieldType(field["@type"]) # required
|
122
|
-
size = int(field.get("@size", 0))
|
123
|
-
scale = int(field.get("@scale", 0))
|
124
|
-
source = field.get("@source", "")
|
125
|
-
desc = field.get("@description", "")
|
126
|
-
metadata.add_field(
|
127
|
-
name=name,
|
128
|
-
field_type=field_type,
|
129
|
-
size=size,
|
130
|
-
scale=scale,
|
131
|
-
source=source,
|
132
|
-
description=desc,
|
133
|
-
)
|
134
|
-
|
135
|
-
return metadata
|
136
|
-
# Add additional context to why KeyError occured
|
137
|
-
except KeyError:
|
138
|
-
# TODO: log error messages (all of them not just this function) instead of printing it when logging goes into file provider
|
139
|
-
print("Metadata XML is missing attributes.")
|
140
|
-
print(
|
141
|
-
"The Metadata XML must have a 'RecordInfo' element as the root element, with 'Field' elements as its children."
|
142
|
-
)
|
143
|
-
print(
|
144
|
-
"Each 'Field' element in the metadata file must have the following attributes: 'name', 'size', 'type'."
|
145
|
-
)
|
146
|
-
raise
|
147
|
-
|
148
|
-
# TODO Remove duplicate code in build_input_anchors and build_output_anchors
|
149
|
-
def build_input_anchors(self) -> List[FileProviderInputAnchor]:
|
150
|
-
"""
|
151
|
-
Build the input anchors based on anchor configuration settings.
|
152
|
-
|
153
|
-
Returns
|
154
|
-
-------
|
155
|
-
List[FileProviderInputAnchor]
|
156
|
-
The list of file provider input anchor information.
|
157
|
-
"""
|
158
|
-
try:
|
159
|
-
anchor_settings = self.workflow_config["AlteryxJavaScriptPlugin"][
|
160
|
-
"GuiSettings"
|
161
|
-
]
|
162
|
-
|
163
|
-
input_anchors = anchor_settings.get("InputConnections")
|
164
|
-
if not input_anchors:
|
165
|
-
input_anchor_configs = []
|
166
|
-
else:
|
167
|
-
input_anchor_configs_raw = input_anchors["Connection"]
|
168
|
-
if not isinstance(input_anchor_configs_raw, list):
|
169
|
-
input_anchor_configs = [input_anchor_configs_raw]
|
170
|
-
else:
|
171
|
-
input_anchor_configs = input_anchor_configs_raw
|
172
|
-
|
173
|
-
return [
|
174
|
-
FileProviderInputAnchor(
|
175
|
-
name=config["@Name"],
|
176
|
-
allow_multiple=config["@AllowMultiple"].lower() == "true",
|
177
|
-
optional=config["@Optional"].lower() == "true",
|
178
|
-
)
|
179
|
-
for config in input_anchor_configs
|
180
|
-
]
|
181
|
-
# error to add more context to KeyError
|
182
|
-
except KeyError:
|
183
|
-
print("Tool's workflow config XML is missing attributes.")
|
184
|
-
print(
|
185
|
-
"Each Connection in the config file must have the following attributes: 'Name', 'AllowMultiple', 'Optional'"
|
186
|
-
)
|
187
|
-
raise
|
188
|
-
|
189
|
-
def build_output_anchors(self) -> List[FileProviderOutputAnchor]:
|
190
|
-
"""
|
191
|
-
Build the output anchors based on tool config settings.
|
192
|
-
|
193
|
-
Returns
|
194
|
-
-------
|
195
|
-
List[FileProviderOutputAnchor]
|
196
|
-
The list of file provider output anchor information.
|
197
|
-
"""
|
198
|
-
try:
|
199
|
-
anchor_settings = self.workflow_config["AlteryxJavaScriptPlugin"][
|
200
|
-
"GuiSettings"
|
201
|
-
]
|
202
|
-
|
203
|
-
output_anchors = anchor_settings.get("OutputConnections")
|
204
|
-
|
205
|
-
if not output_anchors:
|
206
|
-
output_anchor_configs = []
|
207
|
-
else:
|
208
|
-
output_anchor_configs_raw = output_anchors["Connection"]
|
209
|
-
if not isinstance(output_anchor_configs_raw, list):
|
210
|
-
output_anchor_configs = [output_anchor_configs_raw]
|
211
|
-
else:
|
212
|
-
output_anchor_configs = output_anchor_configs_raw
|
213
|
-
|
214
|
-
return [
|
215
|
-
FileProviderOutputAnchor(
|
216
|
-
name=config["@Name"],
|
217
|
-
allow_multiple=False,
|
218
|
-
optional=config["@Optional"].lower() == "true",
|
219
|
-
)
|
220
|
-
for config in output_anchor_configs
|
221
|
-
]
|
222
|
-
# Add more context to why KeyError occured
|
223
|
-
except KeyError:
|
224
|
-
# TODO: Add logging instead of printing
|
225
|
-
print("Tool's workflow config XML is missing attributes.")
|
226
|
-
print(
|
227
|
-
"Each Connection in the config file must have the following attributes: 'Name', 'AllowMultiple', 'Optional'"
|
228
|
-
)
|
229
|
-
raise
|
230
|
-
|
231
|
-
def dataframe_to_csv(self, output_file: Path, dataframe: pd.DataFrame) -> None:
|
232
|
-
"""
|
233
|
-
Convert a pandas dataframe to an output CSV file.
|
234
|
-
|
235
|
-
Parameters
|
236
|
-
----------
|
237
|
-
output_file
|
238
|
-
The path for the output file where the dataframe values should be held.
|
239
|
-
dataframe
|
240
|
-
The pandas dataframe that should be converted to a CSV file.
|
241
|
-
"""
|
242
|
-
# TODO Add error handling for to_csv
|
243
|
-
dataframe.to_csv(
|
244
|
-
output_file,
|
245
|
-
index=False,
|
246
|
-
mode="a" if output_file in self.use_append else "w",
|
247
|
-
header=False if output_file in self.use_append else True,
|
248
|
-
)
|
249
|
-
self.use_append.add(output_file)
|
250
|
-
|
251
|
-
def metadata_to_xml(self, output_file: Path, metadata: Metadata) -> None:
|
252
|
-
"""
|
253
|
-
Convert record metadata to a XML file.
|
254
|
-
|
255
|
-
Parameters
|
256
|
-
----------
|
257
|
-
output_file
|
258
|
-
The path for the output file where the metadata information should be held.
|
259
|
-
metadata
|
260
|
-
The Metadata that should be converted to a XML file.
|
261
|
-
"""
|
262
|
-
# Record each field in record metadata to a different row in an XML file
|
263
|
-
field_list = []
|
264
|
-
for field in metadata.fields:
|
265
|
-
field_dict = {
|
266
|
-
"@name": field.name,
|
267
|
-
"@type": field.type.value,
|
268
|
-
}
|
269
|
-
if field.size:
|
270
|
-
field_dict["@size"] = field.size
|
271
|
-
if field.description:
|
272
|
-
field_dict["@description"] = field.description
|
273
|
-
if field.scale:
|
274
|
-
field_dict["@scale"] = field.scale
|
275
|
-
if field.source:
|
276
|
-
field_dict["@source"] = field.source
|
277
|
-
field_list.append(field_dict)
|
278
|
-
fields_dict = {"Field": field_list}
|
279
|
-
to_xml = {"RecordInfo": fields_dict}
|
280
|
-
|
281
|
-
# Create the output XML file
|
282
|
-
xml = xmltodict.unparse(
|
283
|
-
input_dict=to_xml, pretty=True, short_empty_elements=True
|
284
|
-
)
|
285
|
-
with open(output_file, "w") as fd:
|
286
|
-
fd.write(xml + "\n")
|
@@ -1,185 +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 for testing a tool outside of Designer."""
|
15
|
-
from logging import Logger
|
16
|
-
from pathlib import Path
|
17
|
-
from typing import Dict, List, Optional, TYPE_CHECKING, Type
|
18
|
-
|
19
|
-
from another_ayx_python_sdk.core.doc_utilities import inherit_docs
|
20
|
-
from another_ayx_python_sdk.core.plugin import Plugin
|
21
|
-
from another_ayx_python_sdk.core.provider_base import ProviderBase
|
22
|
-
from another_ayx_python_sdk.core.record_packet import RecordPacket
|
23
|
-
from another_ayx_python_sdk.providers.file_provider.environment import Environment
|
24
|
-
from another_ayx_python_sdk.providers.file_provider.file_adapter import FileAdapter
|
25
|
-
from another_ayx_python_sdk.providers.file_provider.file_provider_dcm import FileProviderDCM
|
26
|
-
from another_ayx_python_sdk.providers.file_provider.file_provider_input_connection import (
|
27
|
-
FileProviderInputConnection,
|
28
|
-
)
|
29
|
-
from another_ayx_python_sdk.providers.file_provider.iox import IO
|
30
|
-
|
31
|
-
import deprecation
|
32
|
-
|
33
|
-
if TYPE_CHECKING:
|
34
|
-
from another_ayx_python_sdk.providers.file_provider.file_provider_input_anchor import (
|
35
|
-
FileProviderInputAnchor,
|
36
|
-
)
|
37
|
-
from another_ayx_python_sdk.providers.file_provider.file_provider_output_anchor import (
|
38
|
-
FileProviderOutputAnchor,
|
39
|
-
)
|
40
|
-
from another_ayx_python_sdk.providers.file_provider.tool_input import AnchorDefinition
|
41
|
-
|
42
|
-
|
43
|
-
user_plugin_class: Optional[Type[Plugin]] = None
|
44
|
-
|
45
|
-
|
46
|
-
@deprecation.deprecated(
|
47
|
-
deprecated_in="1.0.3",
|
48
|
-
removed_in="2.0.0",
|
49
|
-
details="Use the Plugin CLI's test harness instead.",
|
50
|
-
)
|
51
|
-
@inherit_docs
|
52
|
-
class FileProvider(ProviderBase):
|
53
|
-
"""
|
54
|
-
File provider implementation.
|
55
|
-
|
56
|
-
The file provider will instantiate input and output connections for the
|
57
|
-
tool from input files and pass information along to the tool plugin.
|
58
|
-
"""
|
59
|
-
|
60
|
-
def __init__(
|
61
|
-
self,
|
62
|
-
tool_config: Path,
|
63
|
-
workflow_config: Path,
|
64
|
-
inputs: "List[AnchorDefinition]",
|
65
|
-
outputs: "List[AnchorDefinition]",
|
66
|
-
update_tool_config: Optional[Path],
|
67
|
-
):
|
68
|
-
"""
|
69
|
-
Instantiate the file provider.
|
70
|
-
|
71
|
-
Parameters
|
72
|
-
----------
|
73
|
-
tool_config
|
74
|
-
Tool configuration file.
|
75
|
-
workflow_config
|
76
|
-
Configuration file for anchor information.
|
77
|
-
inputs
|
78
|
-
The incoming input information.
|
79
|
-
outputs
|
80
|
-
The information that says where to store the outgoing information.
|
81
|
-
update_tool_config
|
82
|
-
An optional path that indicates whether to update the tool's config. If it is set,
|
83
|
-
the config will be updated at the specified path.
|
84
|
-
"""
|
85
|
-
super().__init__()
|
86
|
-
self.__logger = Logger("File Provider")
|
87
|
-
self.__io = IO()
|
88
|
-
self.__dcm = FileProviderDCM()
|
89
|
-
self.__environment = Environment(update_tool_config)
|
90
|
-
|
91
|
-
self.adapter = FileAdapter(tool_config, workflow_config)
|
92
|
-
self.input_anchors = self.adapter.build_input_anchors()
|
93
|
-
self.output_anchors = self.adapter.build_output_anchors()
|
94
|
-
|
95
|
-
for input in inputs:
|
96
|
-
name = input.anchor_name
|
97
|
-
metadata_file = Path(input.metadata)
|
98
|
-
csv_file = Path(input.records)
|
99
|
-
self.__add_input_connection_to_anchor(name, metadata_file, csv_file)
|
100
|
-
# Add file information to the output anchors
|
101
|
-
for output in outputs:
|
102
|
-
name = output.anchor_name
|
103
|
-
metadata_file = Path(output.metadata)
|
104
|
-
csv_file = Path(output.records)
|
105
|
-
self.__populate_output_anchor(name, metadata_file, csv_file)
|
106
|
-
|
107
|
-
@property
|
108
|
-
def tool_config(self) -> Dict: # noqa: D102
|
109
|
-
return self.adapter.tool_config
|
110
|
-
|
111
|
-
@property
|
112
|
-
def io(self) -> IO: # noqa: D102
|
113
|
-
return self.__io
|
114
|
-
|
115
|
-
@property
|
116
|
-
def dcm(self) -> FileProviderDCM: # noqa: D102
|
117
|
-
return self.__dcm
|
118
|
-
|
119
|
-
@property
|
120
|
-
def environment(self) -> Environment: # noqa: D102
|
121
|
-
return self.__environment
|
122
|
-
|
123
|
-
@property
|
124
|
-
def logger(self) -> "Logger": # noqa: D102
|
125
|
-
return self.__logger
|
126
|
-
|
127
|
-
def __add_input_connection_to_anchor(
|
128
|
-
self, name: str, metadata_file: Path, csv_file: Path
|
129
|
-
) -> None:
|
130
|
-
"""
|
131
|
-
Build an input connection from the provided metadata and record files.
|
132
|
-
|
133
|
-
Parameters
|
134
|
-
----------
|
135
|
-
name
|
136
|
-
The input anchor the connection is associated with.
|
137
|
-
metadata_file
|
138
|
-
The input metadata associated with this connection.
|
139
|
-
csv_file
|
140
|
-
The input record info associated with this connection.
|
141
|
-
"""
|
142
|
-
metadata = self.adapter.xml_to_metadata(metadata_file)
|
143
|
-
dataframe = self.adapter.csv_to_dataframe(csv_file)
|
144
|
-
# TODO deal with max_packet_size
|
145
|
-
record_packet = RecordPacket.from_dataframe(metadata, dataframe)
|
146
|
-
input_anchor = self.get_input_anchor(name)
|
147
|
-
# TODO figure out better input connection name
|
148
|
-
input_connection = FileProviderInputConnection(
|
149
|
-
self.adapter.name, metadata, record_packet, input_anchor
|
150
|
-
)
|
151
|
-
input_anchor.connections.append(input_connection)
|
152
|
-
|
153
|
-
def __populate_output_anchor(
|
154
|
-
self, name: str, metadata_file: Path, csv_file: Path
|
155
|
-
) -> None:
|
156
|
-
"""
|
157
|
-
Add the required file information to the output anchor.
|
158
|
-
|
159
|
-
Parameters
|
160
|
-
----------
|
161
|
-
name
|
162
|
-
The output anchor the file information should be added to.
|
163
|
-
metadata_file
|
164
|
-
The output metadata file associated with this anchor.
|
165
|
-
csv_file
|
166
|
-
The output record info file associated with this connection.
|
167
|
-
"""
|
168
|
-
output_anchor = self.get_output_anchor(name)
|
169
|
-
output_anchor.metadata_file = metadata_file
|
170
|
-
output_anchor.record_file = csv_file
|
171
|
-
output_anchor.file_adapter = self.adapter
|
172
|
-
|
173
|
-
def get_input_anchor(self, name: str) -> "FileProviderInputAnchor": # noqa: D102
|
174
|
-
for input_anchor in self.input_anchors:
|
175
|
-
if name == input_anchor.name:
|
176
|
-
return input_anchor
|
177
|
-
|
178
|
-
raise RuntimeError("There was no input anchor found with name {}".format(name))
|
179
|
-
|
180
|
-
def get_output_anchor(self, name: str) -> "FileProviderOutputAnchor": # noqa: D102
|
181
|
-
for output_anchor in self.output_anchors:
|
182
|
-
if name == output_anchor.name:
|
183
|
-
return output_anchor
|
184
|
-
|
185
|
-
raise RuntimeError("There was no output anchor found with name {}".format(name))
|
@@ -1,53 +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: Proxy class for DCM API."""
|
15
|
-
import datetime as dt
|
16
|
-
from typing import Dict, Optional
|
17
|
-
|
18
|
-
from another_ayx_python_sdk.core import DcmBase
|
19
|
-
from another_ayx_python_sdk.core.doc_utilities import inherit_docs
|
20
|
-
|
21
|
-
|
22
|
-
@inherit_docs
|
23
|
-
class FileProviderDCM(DcmBase):
|
24
|
-
"""Class that wraps DCM API work."""
|
25
|
-
|
26
|
-
def get_connection(self, connection_id: str) -> Dict: # noqa: D102
|
27
|
-
raise NotImplementedError()
|
28
|
-
|
29
|
-
def get_write_lock(
|
30
|
-
self,
|
31
|
-
connection_id: str,
|
32
|
-
role: str,
|
33
|
-
secret_type: str,
|
34
|
-
expires_in: Optional[dt.datetime],
|
35
|
-
) -> Dict: # noqa: D102
|
36
|
-
raise NotImplementedError()
|
37
|
-
|
38
|
-
def free_write_lock(
|
39
|
-
self, connection_id: str, role: str, secret_type: str, lock_id: str
|
40
|
-
) -> None: # noqa: D102
|
41
|
-
raise NotImplementedError()
|
42
|
-
|
43
|
-
def update_connection_secret(
|
44
|
-
self,
|
45
|
-
connection_id: str,
|
46
|
-
lock_id: str,
|
47
|
-
role: str,
|
48
|
-
secret_type: str,
|
49
|
-
value: str,
|
50
|
-
expires_on: Optional[dt.datetime],
|
51
|
-
parameters: Optional[Dict[str, str]],
|
52
|
-
) -> Dict: # noqa: D102
|
53
|
-
raise NotImplementedError()
|