fivetran-connector-sdk 0.12.12.1__py3-none-any.whl → 0.12.17.1__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.
- fivetran_connector_sdk/__init__.py +25 -10
- {fivetran_connector_sdk-0.12.12.1.dist-info → fivetran_connector_sdk-0.12.17.1.dist-info}/METADATA +1 -1
- {fivetran_connector_sdk-0.12.12.1.dist-info → fivetran_connector_sdk-0.12.17.1.dist-info}/RECORD +6 -6
- {fivetran_connector_sdk-0.12.12.1.dist-info → fivetran_connector_sdk-0.12.17.1.dist-info}/WHEEL +0 -0
- {fivetran_connector_sdk-0.12.12.1.dist-info → fivetran_connector_sdk-0.12.17.1.dist-info}/entry_points.txt +0 -0
- {fivetran_connector_sdk-0.12.12.1.dist-info → fivetran_connector_sdk-0.12.17.1.dist-info}/top_level.txt +0 -0
@@ -26,7 +26,7 @@ from fivetran_connector_sdk.protos import common_pb2
|
|
26
26
|
from fivetran_connector_sdk.protos import connector_sdk_pb2
|
27
27
|
from fivetran_connector_sdk.protos import connector_sdk_pb2_grpc
|
28
28
|
|
29
|
-
__version__ = "0.12.
|
29
|
+
__version__ = "0.12.17.1"
|
30
30
|
|
31
31
|
MAC_OS = "mac"
|
32
32
|
WIN_OS = "windows"
|
@@ -38,6 +38,7 @@ VERSION_FILENAME = "version.txt"
|
|
38
38
|
UPLOAD_FILENAME = "code.zip"
|
39
39
|
LAST_VERSION_CHECK_FILE = "_last_version_check"
|
40
40
|
ROOT_LOCATION = ".ft_sdk_connector_tester"
|
41
|
+
CONFIG_FILE = "_config.json"
|
41
42
|
OUTPUT_FILES_DIR = "files"
|
42
43
|
REQUIREMENTS_TXT = "requirements.txt"
|
43
44
|
PYPI_PACKAGE_DETAILS_URL = "https://pypi.org/pypi/fivetran_connector_sdk/json"
|
@@ -57,6 +58,7 @@ COMMANDS_AND_SYNONYMS = {
|
|
57
58
|
CONNECTION_SCHEMA_NAME_PATTERN = r'^[_a-z][_a-z0-9]*$'
|
58
59
|
DEBUGGING = False
|
59
60
|
EXECUTED_VIA_CLI = False
|
61
|
+
PRODUCTION_BASE_URL = "https://api.fivetran.com"
|
60
62
|
TABLES = {}
|
61
63
|
|
62
64
|
JAVA_LONG_MAX_VALUE = 9223372036854775807
|
@@ -508,6 +510,18 @@ def get_available_port():
|
|
508
510
|
return None
|
509
511
|
|
510
512
|
|
513
|
+
def update_base_url_if_required():
|
514
|
+
config_file_path = os.path.join(_tester_root_dir(), CONFIG_FILE)
|
515
|
+
if os.path.isfile(config_file_path):
|
516
|
+
with open(config_file_path, 'r') as f:
|
517
|
+
data = json.load(f)
|
518
|
+
base_url = data.get('production_base_url')
|
519
|
+
if base_url is not None:
|
520
|
+
global PRODUCTION_BASE_URL
|
521
|
+
PRODUCTION_BASE_URL = base_url
|
522
|
+
print_library_log(f"Updating PRODUCTION_BASE_URL to: {base_url}")
|
523
|
+
|
524
|
+
|
511
525
|
class Connector(connector_sdk_pb2_grpc.ConnectorServicer):
|
512
526
|
def __init__(self, update, schema=None):
|
513
527
|
"""Initializes the Connector instance.
|
@@ -522,6 +536,8 @@ class Connector(connector_sdk_pb2_grpc.ConnectorServicer):
|
|
522
536
|
self.configuration = None
|
523
537
|
self.state = None
|
524
538
|
|
539
|
+
update_base_url_if_required()
|
540
|
+
|
525
541
|
@staticmethod
|
526
542
|
def fetch_requirements_from_file(file_path: str) -> list[str]:
|
527
543
|
"""Reads a requirements file and returns a list of dependencies.
|
@@ -746,7 +762,7 @@ class Connector(connector_sdk_pb2_grpc.ConnectorServicer):
|
|
746
762
|
if not config["secrets_list"]:
|
747
763
|
del config["secrets_list"]
|
748
764
|
|
749
|
-
resp = rq.patch(f"
|
765
|
+
resp = rq.patch(f"{PRODUCTION_BASE_URL}/v1/connectors/{id}",
|
750
766
|
headers={"Authorization": f"Basic {deploy_key}"},
|
751
767
|
json={
|
752
768
|
"config": config,
|
@@ -771,7 +787,7 @@ class Connector(connector_sdk_pb2_grpc.ConnectorServicer):
|
|
771
787
|
Returns:
|
772
788
|
str: The connection ID, or None
|
773
789
|
"""
|
774
|
-
resp = rq.get(f"
|
790
|
+
resp = rq.get(f"{PRODUCTION_BASE_URL}/v1/groups/{group_id}/connectors",
|
775
791
|
headers={"Authorization": f"Basic {deploy_key}"},
|
776
792
|
params={"schema": name})
|
777
793
|
if not resp.ok:
|
@@ -796,7 +812,7 @@ class Connector(connector_sdk_pb2_grpc.ConnectorServicer):
|
|
796
812
|
Returns:
|
797
813
|
rq.Response: The response object.
|
798
814
|
"""
|
799
|
-
response = rq.post(f"
|
815
|
+
response = rq.post(f"{PRODUCTION_BASE_URL}/v1/connectors",
|
800
816
|
headers={"Authorization": f"Basic {deploy_key}"},
|
801
817
|
json={
|
802
818
|
"group_id": group_id,
|
@@ -888,7 +904,7 @@ class Connector(connector_sdk_pb2_grpc.ConnectorServicer):
|
|
888
904
|
bool: True if the upload was successful, False otherwise.
|
889
905
|
"""
|
890
906
|
print_library_log("Uploading your project...")
|
891
|
-
response = rq.post(f"
|
907
|
+
response = rq.post(f"{PRODUCTION_BASE_URL}/v1/deploy/{group_id}/{connection}",
|
892
908
|
files={'file': open(local_path, 'rb')},
|
893
909
|
headers={"Authorization": f"Basic {deploy_key}"})
|
894
910
|
if response.ok:
|
@@ -911,7 +927,7 @@ class Connector(connector_sdk_pb2_grpc.ConnectorServicer):
|
|
911
927
|
bool: True if the cleanup was successful, False otherwise.
|
912
928
|
"""
|
913
929
|
print_library_log("INFO: Cleaning up your uploaded project ")
|
914
|
-
response = rq.post(f"
|
930
|
+
response = rq.post(f"{PRODUCTION_BASE_URL}/v1/cleanup_code/{group_id}/{connection}",
|
915
931
|
headers={"Authorization": f"Basic {deploy_key}"})
|
916
932
|
if response.ok:
|
917
933
|
print("✓")
|
@@ -947,7 +963,7 @@ class Connector(connector_sdk_pb2_grpc.ConnectorServicer):
|
|
947
963
|
Returns:
|
948
964
|
tuple[str, str]: A tuple containing the group ID and group name.
|
949
965
|
"""
|
950
|
-
groups_url = "
|
966
|
+
groups_url = f"{PRODUCTION_BASE_URL}/v1/groups"
|
951
967
|
|
952
968
|
params = {"limit": 500}
|
953
969
|
headers = {"Authorization": f"Basic {deploy_key}"}
|
@@ -1096,8 +1112,7 @@ class Connector(connector_sdk_pb2_grpc.ConnectorServicer):
|
|
1096
1112
|
print("✓")
|
1097
1113
|
except:
|
1098
1114
|
shutil.rmtree(tester_root_dir)
|
1099
|
-
raise RuntimeError(f"\nSEVERE: Failed to install the connector tester. Error details: "
|
1100
|
-
traceback.format_exc())
|
1115
|
+
raise RuntimeError(f"\nSEVERE: Failed to install the connector tester. Error details: {traceback.format_exc()}")
|
1101
1116
|
|
1102
1117
|
project_path = os.getcwd() if project_path is None else project_path
|
1103
1118
|
self.validate_requirements_file(project_path, False)
|
@@ -1114,7 +1129,7 @@ class Connector(connector_sdk_pb2_grpc.ConnectorServicer):
|
|
1114
1129
|
# server.wait_for_termination()
|
1115
1130
|
|
1116
1131
|
try:
|
1117
|
-
print_library_log(
|
1132
|
+
print_library_log("Running connector tester...")
|
1118
1133
|
for log_msg in self.__run_tester(java_exe, tester_root_dir, project_path, available_port):
|
1119
1134
|
print(log_msg, end="")
|
1120
1135
|
except:
|
{fivetran_connector_sdk-0.12.12.1.dist-info → fivetran_connector_sdk-0.12.17.1.dist-info}/METADATA
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: fivetran_connector_sdk
|
3
|
-
Version: 0.12.
|
3
|
+
Version: 0.12.17.1
|
4
4
|
Summary: Build custom connectors on Fivetran platform
|
5
5
|
Author-email: Fivetran <developers@fivetran.com>
|
6
6
|
Project-URL: Homepage, https://fivetran.com/docs/connectors/connector-sdk
|
{fivetran_connector_sdk-0.12.12.1.dist-info → fivetran_connector_sdk-0.12.17.1.dist-info}/RECORD
RENAMED
@@ -1,4 +1,4 @@
|
|
1
|
-
fivetran_connector_sdk/__init__.py,sha256=
|
1
|
+
fivetran_connector_sdk/__init__.py,sha256=DFQiZdtyqblI_7npsJzaZ7jicU0U1B5LXA1SZY-WeYI,63949
|
2
2
|
fivetran_connector_sdk/protos/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
3
3
|
fivetran_connector_sdk/protos/common_pb2.py,sha256=kUwVcyZHgLigNR-KnHZn7dHrlxaMnUXqzprsRx6T72M,6831
|
4
4
|
fivetran_connector_sdk/protos/common_pb2.pyi,sha256=S0hdIzoXyyOKD5cjiGeDDLYpQ9J3LjAvu4rCj1JvJWE,9038
|
@@ -6,8 +6,8 @@ fivetran_connector_sdk/protos/common_pb2_grpc.py,sha256=1oboBPFxaTEXt9Aw7EAj8gXH
|
|
6
6
|
fivetran_connector_sdk/protos/connector_sdk_pb2.py,sha256=9Ke_Ti1s0vAeXapfXT-EryrT2-TSGQb8mhs4gxTpUMk,7732
|
7
7
|
fivetran_connector_sdk/protos/connector_sdk_pb2.pyi,sha256=FWYxRgshEF3QDYAE0TM_mv4N2gGvkxCH_uPpxnMc4oA,8406
|
8
8
|
fivetran_connector_sdk/protos/connector_sdk_pb2_grpc.py,sha256=ZfJLp4DW7uP4pFOZ74s_wQ6tD3eIPi-08UfnLwe4tzo,7163
|
9
|
-
fivetran_connector_sdk-0.12.
|
10
|
-
fivetran_connector_sdk-0.12.
|
11
|
-
fivetran_connector_sdk-0.12.
|
12
|
-
fivetran_connector_sdk-0.12.
|
13
|
-
fivetran_connector_sdk-0.12.
|
9
|
+
fivetran_connector_sdk-0.12.17.1.dist-info/METADATA,sha256=_ORD9BvuGvj63YvicMhGKKi9N7m7QuXyN1v0dQ3GDIw,2939
|
10
|
+
fivetran_connector_sdk-0.12.17.1.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
11
|
+
fivetran_connector_sdk-0.12.17.1.dist-info/entry_points.txt,sha256=uQn0KPnFlQmXJfxlk0tifdNsSXWfVlnAFzNqjXZM_xM,57
|
12
|
+
fivetran_connector_sdk-0.12.17.1.dist-info/top_level.txt,sha256=-_xk2MFY4psIh7jw1lJePMzFb5-vask8_ZtX-UzYWUI,23
|
13
|
+
fivetran_connector_sdk-0.12.17.1.dist-info/RECORD,,
|
{fivetran_connector_sdk-0.12.12.1.dist-info → fivetran_connector_sdk-0.12.17.1.dist-info}/WHEEL
RENAMED
File without changes
|
File without changes
|
File without changes
|