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,109 +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
|
-
"""FieldProxy class definition."""
|
15
|
-
from typing import Any
|
16
|
-
|
17
|
-
from another_ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK import Field, RecordCreator, RecordRef
|
18
|
-
|
19
|
-
from another_ayx_python_sdk.core.constants import NULL_VALUE_PLACEHOLDER
|
20
|
-
|
21
|
-
|
22
|
-
class FieldProxy:
|
23
|
-
"""Proxy for Field class from the raw Python SDK."""
|
24
|
-
|
25
|
-
field_getters_map = {
|
26
|
-
"blob": "get_as_blob",
|
27
|
-
"byte": "get_as_int32",
|
28
|
-
"int16": "get_as_int32",
|
29
|
-
"int32": "get_as_int32",
|
30
|
-
"int64": "get_as_int64",
|
31
|
-
"float": "get_as_double",
|
32
|
-
"double": "get_as_double",
|
33
|
-
"date": "get_as_string",
|
34
|
-
"time": "get_as_string",
|
35
|
-
"datetime": "get_as_string",
|
36
|
-
"bool": "get_as_bool",
|
37
|
-
"string": "get_as_string",
|
38
|
-
"v_string": "get_as_string",
|
39
|
-
"v_wstring": "get_as_string",
|
40
|
-
"wstring": "get_as_string",
|
41
|
-
"fixeddecimal": "get_as_double",
|
42
|
-
"spatialobj": "get_as_blob",
|
43
|
-
}
|
44
|
-
|
45
|
-
field_setters_map = {
|
46
|
-
"bool": "set_from_bool",
|
47
|
-
"blob": "set_from_blob",
|
48
|
-
"double": "set_from_double",
|
49
|
-
"float": "set_from_double",
|
50
|
-
"fixeddecimal": "set_from_double",
|
51
|
-
"byte": "set_from_int32",
|
52
|
-
"int16": "set_from_int32",
|
53
|
-
"int32": "set_from_int32",
|
54
|
-
"int64": "set_from_int64",
|
55
|
-
"string": "set_from_string",
|
56
|
-
"v_string": "set_from_string",
|
57
|
-
"v_wstring": "set_from_string",
|
58
|
-
"wstring": "set_from_string",
|
59
|
-
"date": "set_from_string",
|
60
|
-
"datetime": "set_from_string",
|
61
|
-
"time": "set_from_string",
|
62
|
-
}
|
63
|
-
|
64
|
-
field_cast_map = {
|
65
|
-
"bool": bool,
|
66
|
-
"blob": bytes,
|
67
|
-
"double": float,
|
68
|
-
"float": float,
|
69
|
-
"fixeddecimal": float,
|
70
|
-
"byte": int,
|
71
|
-
"int16": int,
|
72
|
-
"int32": int,
|
73
|
-
"int64": int,
|
74
|
-
"string": str,
|
75
|
-
"v_string": str,
|
76
|
-
"v_wstring": str,
|
77
|
-
"wstring": str,
|
78
|
-
"date": str,
|
79
|
-
"datetime": str,
|
80
|
-
"time": str,
|
81
|
-
}
|
82
|
-
|
83
|
-
__slots__ = ["name", "_raw_field", "_getter", "_setter", "_caster", "_set_null"]
|
84
|
-
|
85
|
-
def __init__(self, raw_field: Field):
|
86
|
-
"""Construct a field proxy object."""
|
87
|
-
self.name = raw_field.name
|
88
|
-
self._raw_field = raw_field
|
89
|
-
|
90
|
-
field_type = str(raw_field.type)
|
91
|
-
self._getter = getattr(raw_field, self.field_getters_map[field_type])
|
92
|
-
self._setter = getattr(raw_field, self.field_setters_map[field_type])
|
93
|
-
self._caster = self.field_cast_map[field_type]
|
94
|
-
self._set_null = self._raw_field.set_null
|
95
|
-
|
96
|
-
def get(self, record: RecordRef) -> Any:
|
97
|
-
"""Get the value for this field from a record."""
|
98
|
-
return self._getter(record)
|
99
|
-
|
100
|
-
def set(self, record_creator: RecordCreator, value: Any) -> None:
|
101
|
-
"""Set the field for a given record to a value."""
|
102
|
-
if value is NULL_VALUE_PLACEHOLDER:
|
103
|
-
return self.set_null(record_creator)
|
104
|
-
|
105
|
-
self._setter(record_creator, self._caster(value))
|
106
|
-
|
107
|
-
def set_null(self, record_creator: RecordCreator) -> None:
|
108
|
-
"""Set the field for a given record to null."""
|
109
|
-
self._set_null(record_creator)
|
@@ -1,49 +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
|
-
"""RecordCopierProxy class definition."""
|
15
|
-
from typing import Mapping
|
16
|
-
|
17
|
-
from another_ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK import RecordCopier, RecordCreator, RecordInfo, RecordRef
|
18
|
-
|
19
|
-
|
20
|
-
class RecordCopierProxy:
|
21
|
-
"""Proxy for RecordCopier class from raw Python SDK."""
|
22
|
-
|
23
|
-
__slots__ = ["_input_record_info", "_output_record_info", "_record_copier"]
|
24
|
-
|
25
|
-
def __init__(
|
26
|
-
self,
|
27
|
-
input_record_info: RecordInfo,
|
28
|
-
output_record_info: RecordInfo,
|
29
|
-
field_name_map: Mapping[str, str],
|
30
|
-
):
|
31
|
-
"""Construct a record copier proxy object."""
|
32
|
-
self._input_record_info = input_record_info
|
33
|
-
self._output_record_info = output_record_info
|
34
|
-
self._record_copier = RecordCopier(input_record_info, output_record_info)
|
35
|
-
|
36
|
-
for input_name, output_name in field_name_map.items():
|
37
|
-
input_idx = input_record_info.get_field_num(input_name)
|
38
|
-
storage_idx = output_record_info.get_field_num(output_name)
|
39
|
-
|
40
|
-
self._record_copier.add(storage_idx, input_idx)
|
41
|
-
|
42
|
-
self._record_copier.done_adding()
|
43
|
-
|
44
|
-
def copy(self, record: RecordRef) -> RecordCreator:
|
45
|
-
"""Copy a record into a new record creator."""
|
46
|
-
record_creator = self._output_record_info.construct_record_creator()
|
47
|
-
self._record_copier.copy(record_creator, record)
|
48
|
-
|
49
|
-
return record_creator
|
@@ -1,23 +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
|
-
"""Record class definitions."""
|
15
|
-
from .base_record_container import BaseRecordContainer
|
16
|
-
from .parsed_record_container import ParsedRecordContainer
|
17
|
-
from .raw_record_container import RawRecordContainer
|
18
|
-
|
19
|
-
__all__ = [
|
20
|
-
"BaseRecordContainer",
|
21
|
-
"ParsedRecordContainer",
|
22
|
-
"RawRecordContainer",
|
23
|
-
]
|
@@ -1,47 +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
|
-
"""BaseRecordContainer class definition."""
|
15
|
-
from abc import ABC, abstractmethod
|
16
|
-
from typing import Any, List, TYPE_CHECKING
|
17
|
-
|
18
|
-
|
19
|
-
if TYPE_CHECKING:
|
20
|
-
from another_ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK import RecordRef
|
21
|
-
import pandas as pd
|
22
|
-
|
23
|
-
|
24
|
-
class BaseRecordContainer(ABC):
|
25
|
-
"""Container for records."""
|
26
|
-
|
27
|
-
__slots__ = ["records"]
|
28
|
-
|
29
|
-
def __init__(self) -> None:
|
30
|
-
"""Construct a record container."""
|
31
|
-
self.records: List[Any] = []
|
32
|
-
|
33
|
-
@abstractmethod
|
34
|
-
def add_record(self, record: "RecordRef") -> None:
|
35
|
-
"""Make a copy of the record and add it to the container."""
|
36
|
-
|
37
|
-
@abstractmethod
|
38
|
-
def build_dataframe(self) -> "pd.DataFrame":
|
39
|
-
"""Build a dataframe from the records."""
|
40
|
-
|
41
|
-
@abstractmethod
|
42
|
-
def update_with_dataframe(self, df: "pd.DataFrame") -> None:
|
43
|
-
"""Update container with a dataframe."""
|
44
|
-
|
45
|
-
def clear_records(self) -> None:
|
46
|
-
"""Clear all accumulated records."""
|
47
|
-
self.records = []
|
@@ -1,67 +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
|
-
"""ParsedRecordContainer class definition."""
|
15
|
-
from typing import Any, List, Optional, TYPE_CHECKING
|
16
|
-
|
17
|
-
from another_ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK import RecordInfo, RecordRef
|
18
|
-
|
19
|
-
from .base_record_container import BaseRecordContainer
|
20
|
-
from ..proxies import FieldProxy
|
21
|
-
|
22
|
-
if TYPE_CHECKING:
|
23
|
-
import pandas as pd
|
24
|
-
|
25
|
-
|
26
|
-
class ParsedRecordContainer(BaseRecordContainer):
|
27
|
-
"""Container for parsing and holding parsed records."""
|
28
|
-
|
29
|
-
__slots__ = ["records", "_input_fields", "_field_names_to_parse", "_parse_fields"]
|
30
|
-
|
31
|
-
def __init__(
|
32
|
-
self,
|
33
|
-
input_record_info: RecordInfo,
|
34
|
-
field_names_to_parse: Optional[List[str]] = None,
|
35
|
-
) -> None:
|
36
|
-
"""Construct a container."""
|
37
|
-
self._input_fields = {
|
38
|
-
field.name: FieldProxy(field) for field in input_record_info
|
39
|
-
}
|
40
|
-
|
41
|
-
if field_names_to_parse is None:
|
42
|
-
self._field_names_to_parse = [field.name for field in input_record_info]
|
43
|
-
else:
|
44
|
-
self._field_names_to_parse = field_names_to_parse
|
45
|
-
|
46
|
-
self._parse_fields = [
|
47
|
-
self._input_fields[field_name] for field_name in self._field_names_to_parse
|
48
|
-
]
|
49
|
-
|
50
|
-
self.records: List[List[Any]] = []
|
51
|
-
|
52
|
-
def add_record(self, record: RecordRef) -> None:
|
53
|
-
"""Add a new record to the container and parse it."""
|
54
|
-
self.records.append(self._parse_record(record))
|
55
|
-
|
56
|
-
def _parse_record(self, record: RecordRef) -> List[Any]:
|
57
|
-
return [field.get(record) for field in self._parse_fields]
|
58
|
-
|
59
|
-
def build_dataframe(self) -> "pd.DataFrame":
|
60
|
-
"""Build a dataframe out of the parsed records."""
|
61
|
-
import pandas as pd
|
62
|
-
|
63
|
-
return pd.DataFrame(self.records, columns=self._field_names_to_parse)
|
64
|
-
|
65
|
-
def update_with_dataframe(self, df: "pd.DataFrame") -> None:
|
66
|
-
"""Update container with a dataframe."""
|
67
|
-
raise NotImplementedError()
|
@@ -1,111 +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
|
-
"""RawRecordContainer class definition."""
|
15
|
-
from typing import Dict, List, Optional, TYPE_CHECKING
|
16
|
-
|
17
|
-
from another_ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK import RecordCreator, RecordInfo, RecordRef
|
18
|
-
|
19
|
-
from another_ayx_python_sdk.providers.e1_provider.proxies import (
|
20
|
-
FieldProxy,
|
21
|
-
RecordCopierProxy,
|
22
|
-
)
|
23
|
-
from another_ayx_python_sdk.providers.e1_provider.records.base_record_container import (
|
24
|
-
BaseRecordContainer,
|
25
|
-
)
|
26
|
-
from another_ayx_python_sdk.providers.e1_provider.utilities import (
|
27
|
-
fill_df_nulls_with_blackbird_nulls,
|
28
|
-
)
|
29
|
-
|
30
|
-
|
31
|
-
if TYPE_CHECKING:
|
32
|
-
import pandas as pd
|
33
|
-
|
34
|
-
|
35
|
-
class RawRecordContainer(BaseRecordContainer):
|
36
|
-
"""Container for copying and holding raw records."""
|
37
|
-
|
38
|
-
__slots__ = [
|
39
|
-
"records",
|
40
|
-
"_input_record_info",
|
41
|
-
"_storage_record_info",
|
42
|
-
"_field_map",
|
43
|
-
"_record_copier",
|
44
|
-
"_input_fields",
|
45
|
-
]
|
46
|
-
|
47
|
-
def __init__(
|
48
|
-
self,
|
49
|
-
input_record_info: RecordInfo,
|
50
|
-
storage_record_info: Optional[RecordInfo] = None,
|
51
|
-
field_map: Optional[Dict[str, str]] = None,
|
52
|
-
) -> None:
|
53
|
-
"""Construct a container."""
|
54
|
-
super().__init__()
|
55
|
-
if (storage_record_info is None) ^ (field_map is None):
|
56
|
-
raise ValueError(
|
57
|
-
"storage_record_info and field_map must both be specified."
|
58
|
-
)
|
59
|
-
|
60
|
-
self._input_record_info = input_record_info
|
61
|
-
|
62
|
-
if storage_record_info is None:
|
63
|
-
self._storage_record_info = self._input_record_info.clone()
|
64
|
-
else:
|
65
|
-
self._storage_record_info = storage_record_info
|
66
|
-
|
67
|
-
if field_map is None:
|
68
|
-
self._field_map = {
|
69
|
-
str(field.name): str(field.name) for field in self._storage_record_info
|
70
|
-
}
|
71
|
-
else:
|
72
|
-
self._field_map = field_map
|
73
|
-
|
74
|
-
self._record_copier = RecordCopierProxy(
|
75
|
-
self._input_record_info, self._storage_record_info, self._field_map
|
76
|
-
)
|
77
|
-
self._input_fields = {
|
78
|
-
field.name: FieldProxy(field) for field in input_record_info
|
79
|
-
}
|
80
|
-
self.records: List[RecordCreator] = []
|
81
|
-
|
82
|
-
def add_record(self, record: RecordRef) -> None:
|
83
|
-
"""Make a copy of the record and add it to the container."""
|
84
|
-
self.records.append(self._record_copier.copy(record))
|
85
|
-
|
86
|
-
def build_dataframe(self) -> "pd.DataFrame":
|
87
|
-
"""Build a dataframe from the container."""
|
88
|
-
raise NotImplementedError()
|
89
|
-
|
90
|
-
def update_with_dataframe(self, df: "pd.DataFrame") -> None:
|
91
|
-
"""Update stored records with values from a dataframe."""
|
92
|
-
num_rows, _ = df.shape
|
93
|
-
|
94
|
-
if num_rows != len(self.records):
|
95
|
-
raise ValueError(
|
96
|
-
"Dataframe and source container must have the same number of records."
|
97
|
-
)
|
98
|
-
|
99
|
-
fill_df_nulls_with_blackbird_nulls(df)
|
100
|
-
|
101
|
-
for record, (_, row) in zip(self.records, df.iterrows()):
|
102
|
-
for column_name in list(df):
|
103
|
-
try:
|
104
|
-
field = self._storage_record_info.get_field_by_name(column_name)
|
105
|
-
if field is None:
|
106
|
-
raise Exception()
|
107
|
-
except Exception:
|
108
|
-
raise RuntimeError(
|
109
|
-
f"Couldn't update field '{column_name}' that does not exist"
|
110
|
-
)
|
111
|
-
FieldProxy(field).set(record, row[column_name])
|
@@ -1,132 +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
|
-
"""Tool configuration loader definition."""
|
15
|
-
import os
|
16
|
-
import sys
|
17
|
-
from enum import Enum
|
18
|
-
from pathlib import Path
|
19
|
-
from typing import Any, Dict, Tuple
|
20
|
-
|
21
|
-
import xmltodict
|
22
|
-
|
23
|
-
|
24
|
-
class ToolInstallType(str, Enum):
|
25
|
-
"""Tool install type enumeration."""
|
26
|
-
|
27
|
-
user = "user"
|
28
|
-
admin = "admin"
|
29
|
-
alteryx = "alteryx"
|
30
|
-
noinstall = "noinstall" # for linux builds
|
31
|
-
|
32
|
-
|
33
|
-
class ToolInstallMetadata:
|
34
|
-
"""Tool installation metadata."""
|
35
|
-
|
36
|
-
def __init__(
|
37
|
-
self, install_path: Path, venv_path: Path, install_type: ToolInstallType
|
38
|
-
):
|
39
|
-
self.install_path = install_path
|
40
|
-
self.venv_path = venv_path
|
41
|
-
self.install_type = install_type
|
42
|
-
|
43
|
-
|
44
|
-
class ToolConfigLoader:
|
45
|
-
"""Tool configuration loader definition."""
|
46
|
-
|
47
|
-
def __init__(self, tool_directory_name: str):
|
48
|
-
"""Construct a tool configuration loader."""
|
49
|
-
self.tool_directory_name = tool_directory_name
|
50
|
-
|
51
|
-
def get_tool_config(self) -> Dict[str, Any]:
|
52
|
-
"""Get the tool config of this tool from its config.xml file."""
|
53
|
-
try:
|
54
|
-
with open(str(self.get_tool_config_filepath())) as fd:
|
55
|
-
tool_config = dict(xmltodict.parse(fd.read(), strip_whitespace=False))
|
56
|
-
except FileNotFoundError:
|
57
|
-
raise RuntimeError(
|
58
|
-
f"Couldn't find tool with name {self.tool_directory_name}."
|
59
|
-
)
|
60
|
-
else:
|
61
|
-
return tool_config
|
62
|
-
|
63
|
-
def get_tool_config_filepath(self) -> Path:
|
64
|
-
"""Get the path to the tool configuration file."""
|
65
|
-
tool_path, _ = self._get_tool_path()
|
66
|
-
return Path(
|
67
|
-
os.path.join(str(tool_path), f"{self.tool_directory_name}Config.xml")
|
68
|
-
)
|
69
|
-
|
70
|
-
def get_tool_install_metadata(self) -> ToolInstallMetadata:
|
71
|
-
"""Get tool install metadata."""
|
72
|
-
tool_path, install_type = self._get_tool_path()
|
73
|
-
venv_path = self._get_tool_venv_path(
|
74
|
-
self.get_tool_config(), tool_path, install_type
|
75
|
-
)
|
76
|
-
return ToolInstallMetadata(
|
77
|
-
install_path=tool_path, venv_path=venv_path, install_type=install_type
|
78
|
-
)
|
79
|
-
|
80
|
-
def _get_tool_path(self) -> Tuple[Path, ToolInstallType]:
|
81
|
-
"""Get the path to the directory containing the current tool's definition."""
|
82
|
-
tools_path, install_type = self._get_tools_location()
|
83
|
-
return (
|
84
|
-
Path(os.path.join(str(tools_path), self.tool_directory_name)),
|
85
|
-
install_type,
|
86
|
-
)
|
87
|
-
|
88
|
-
def _get_tools_location(self) -> Tuple[Path, ToolInstallType]:
|
89
|
-
"""Get the location of Alteryx tools that contain the current tool."""
|
90
|
-
linux_path = Path("/opt/alteryx")
|
91
|
-
if linux_path.is_dir():
|
92
|
-
return linux_path, ToolInstallType.noinstall
|
93
|
-
|
94
|
-
tools_rel_path = Path("Alteryx") / "Tools"
|
95
|
-
admin_path = Path(os.environ["ALLUSERSPROFILE"]) / tools_rel_path
|
96
|
-
user_path = Path(os.environ["APPDATA"]) / tools_rel_path
|
97
|
-
|
98
|
-
alteryx_bin = (
|
99
|
-
Path(os.path.dirname(sys.executable))
|
100
|
-
if "AlteryxEngineCmd.exe" in sys.executable
|
101
|
-
else Path("")
|
102
|
-
)
|
103
|
-
html_plugins_path = alteryx_bin / "HtmlPlugins"
|
104
|
-
|
105
|
-
for path, install_type in (
|
106
|
-
(user_path, ToolInstallType.user),
|
107
|
-
(admin_path, ToolInstallType.admin),
|
108
|
-
(html_plugins_path, ToolInstallType.alteryx),
|
109
|
-
):
|
110
|
-
if path.is_dir() and self.tool_directory_name in [
|
111
|
-
child_dir.name for child_dir in path.iterdir()
|
112
|
-
]:
|
113
|
-
return path, install_type
|
114
|
-
|
115
|
-
raise RuntimeError("Tool is not located in Alteryx install locations.")
|
116
|
-
|
117
|
-
@staticmethod
|
118
|
-
def _get_tool_venv_path(
|
119
|
-
config: Dict, tool_path: Path, install_type: ToolInstallType
|
120
|
-
) -> Path:
|
121
|
-
"""Get the path to the current tools virtual environment."""
|
122
|
-
try:
|
123
|
-
tool_family_name = config["AlteryxJavaScriptPlugin"]["EngineSettings"][
|
124
|
-
"@ToolFamily"
|
125
|
-
]
|
126
|
-
except KeyError:
|
127
|
-
venv_path = tool_path
|
128
|
-
else:
|
129
|
-
venv_name = f"{tool_family_name}_venv"
|
130
|
-
venv_path = tool_path / ".." / venv_name
|
131
|
-
|
132
|
-
return venv_path.resolve()
|
@@ -1,35 +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
|
-
"""Utility definitions."""
|
15
|
-
from typing import TYPE_CHECKING
|
16
|
-
|
17
|
-
from another_ayx_python_sdk.core.constants import NULL_VALUE_PLACEHOLDER
|
18
|
-
|
19
|
-
from .utilities import convert_metadata_to_record_info, convert_record_info_to_metadata
|
20
|
-
|
21
|
-
if TYPE_CHECKING:
|
22
|
-
import pandas as pd
|
23
|
-
|
24
|
-
|
25
|
-
def fill_df_nulls_with_blackbird_nulls(df: "pd.DataFrame") -> None:
|
26
|
-
"""Fill all dataframe null values with blackbird's representation."""
|
27
|
-
df.fillna(NULL_VALUE_PLACEHOLDER, inplace=True)
|
28
|
-
|
29
|
-
|
30
|
-
__all__ = [
|
31
|
-
"convert_metadata_to_record_info",
|
32
|
-
"convert_record_info_to_metadata",
|
33
|
-
"fill_df_nulls_with_blackbird_nulls",
|
34
|
-
"NULL_VALUE_PLACEHOLDER",
|
35
|
-
]
|
@@ -1,54 +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
|
-
"""Utility methods for common functionality."""
|
15
|
-
import another_ayx_python_sdk.providers.e1_provider.mock_e1_sdk.AlteryxPythonSDK as Sdk
|
16
|
-
|
17
|
-
from another_ayx_python_sdk.core.field import Field, FieldType
|
18
|
-
from another_ayx_python_sdk.core.metadata import Metadata
|
19
|
-
|
20
|
-
|
21
|
-
def convert_record_info_to_metadata(record_info: Sdk.RecordInfo) -> Metadata:
|
22
|
-
"""Convert the RecordInfo to Core Metadata."""
|
23
|
-
return Metadata(
|
24
|
-
[
|
25
|
-
Field(
|
26
|
-
name=field.name,
|
27
|
-
field_type=FieldType[str(field.type)],
|
28
|
-
size=field.size,
|
29
|
-
scale=field.scale,
|
30
|
-
source=field.source,
|
31
|
-
description=field.description,
|
32
|
-
)
|
33
|
-
for field in record_info
|
34
|
-
]
|
35
|
-
)
|
36
|
-
|
37
|
-
|
38
|
-
def convert_metadata_to_record_info(
|
39
|
-
metadata: Metadata, engine: Sdk.AlteryxEngine
|
40
|
-
) -> Sdk.RecordInfo:
|
41
|
-
"""Convert between the metadata object and a Python SDK RecordInfo object."""
|
42
|
-
record_info = Sdk.RecordInfo(engine)
|
43
|
-
|
44
|
-
for field in metadata:
|
45
|
-
record_info.add_field(
|
46
|
-
field_name=field.name,
|
47
|
-
field_type=getattr(Sdk.FieldType, str(field.type.name)),
|
48
|
-
size=field.size,
|
49
|
-
scale=field.scale,
|
50
|
-
source=field.source,
|
51
|
-
description=field.description,
|
52
|
-
)
|
53
|
-
|
54
|
-
return record_info
|
@@ -1,31 +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 tool workflow configuration definition."""
|
15
|
-
from collections import UserDict
|
16
|
-
from copy import deepcopy
|
17
|
-
|
18
|
-
import xmltodict
|
19
|
-
|
20
|
-
|
21
|
-
class WorkflowConfiguration(UserDict):
|
22
|
-
"""Workflow configuration."""
|
23
|
-
|
24
|
-
__slots__ = ["data", "original_data"]
|
25
|
-
|
26
|
-
def __init__(self, config_str: str):
|
27
|
-
"""Initialize a workflow configuration."""
|
28
|
-
self.data = (
|
29
|
-
xmltodict.parse(config_str, strip_whitespace=False)["Configuration"] or {}
|
30
|
-
)
|
31
|
-
self.original_data = deepcopy(self.data)
|