fivetran-connector-sdk 1.2.1__tar.gz → 1.3.0__tar.gz
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-1.2.1 → fivetran_connector_sdk-1.3.0}/PKG-INFO +2 -2
- {fivetran_connector_sdk-1.2.1 → fivetran_connector_sdk-1.3.0}/src/fivetran_connector_sdk/__init__.py +25 -16
- {fivetran_connector_sdk-1.2.1 → fivetran_connector_sdk-1.3.0}/src/fivetran_connector_sdk.egg-info/PKG-INFO +2 -2
- {fivetran_connector_sdk-1.2.1 → fivetran_connector_sdk-1.3.0}/README.md +0 -0
- {fivetran_connector_sdk-1.2.1 → fivetran_connector_sdk-1.3.0}/pyproject.toml +0 -0
- {fivetran_connector_sdk-1.2.1 → fivetran_connector_sdk-1.3.0}/setup.cfg +0 -0
- {fivetran_connector_sdk-1.2.1 → fivetran_connector_sdk-1.3.0}/src/fivetran_connector_sdk/protos/__init__.py +0 -0
- {fivetran_connector_sdk-1.2.1 → fivetran_connector_sdk-1.3.0}/src/fivetran_connector_sdk/protos/common_pb2.py +0 -0
- {fivetran_connector_sdk-1.2.1 → fivetran_connector_sdk-1.3.0}/src/fivetran_connector_sdk/protos/common_pb2.pyi +0 -0
- {fivetran_connector_sdk-1.2.1 → fivetran_connector_sdk-1.3.0}/src/fivetran_connector_sdk/protos/common_pb2_grpc.py +0 -0
- {fivetran_connector_sdk-1.2.1 → fivetran_connector_sdk-1.3.0}/src/fivetran_connector_sdk/protos/connector_sdk_pb2.py +0 -0
- {fivetran_connector_sdk-1.2.1 → fivetran_connector_sdk-1.3.0}/src/fivetran_connector_sdk/protos/connector_sdk_pb2.pyi +0 -0
- {fivetran_connector_sdk-1.2.1 → fivetran_connector_sdk-1.3.0}/src/fivetran_connector_sdk/protos/connector_sdk_pb2_grpc.py +0 -0
- {fivetran_connector_sdk-1.2.1 → fivetran_connector_sdk-1.3.0}/src/fivetran_connector_sdk.egg-info/SOURCES.txt +0 -0
- {fivetran_connector_sdk-1.2.1 → fivetran_connector_sdk-1.3.0}/src/fivetran_connector_sdk.egg-info/dependency_links.txt +0 -0
- {fivetran_connector_sdk-1.2.1 → fivetran_connector_sdk-1.3.0}/src/fivetran_connector_sdk.egg-info/entry_points.txt +0 -0
- {fivetran_connector_sdk-1.2.1 → fivetran_connector_sdk-1.3.0}/src/fivetran_connector_sdk.egg-info/requires.txt +0 -0
- {fivetran_connector_sdk-1.2.1 → fivetran_connector_sdk-1.3.0}/src/fivetran_connector_sdk.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.4
|
2
2
|
Name: fivetran_connector_sdk
|
3
|
-
Version: 1.
|
3
|
+
Version: 1.3.0
|
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-1.2.1 → fivetran_connector_sdk-1.3.0}/src/fivetran_connector_sdk/__init__.py
RENAMED
@@ -31,13 +31,13 @@ from fivetran_connector_sdk.protos import connector_sdk_pb2_grpc
|
|
31
31
|
|
32
32
|
# Version format: <major_version>.<minor_version>.<patch_version>
|
33
33
|
# (where Major Version = 1 for GA, Minor Version is incremental MM from Jan 25 onwards, Patch Version is incremental within a month)
|
34
|
-
__version__ = "1.
|
34
|
+
__version__ = "1.3.0"
|
35
35
|
|
36
36
|
MAC_OS = "mac"
|
37
37
|
WIN_OS = "windows"
|
38
38
|
LINUX_OS = "linux"
|
39
39
|
|
40
|
-
TESTER_VERSION = "0.25.
|
40
|
+
TESTER_VERSION = "0.25.0403.001"
|
41
41
|
TESTER_FILENAME = "run_sdk_tester.jar"
|
42
42
|
VERSION_FILENAME = "version.txt"
|
43
43
|
UPLOAD_FILENAME = "code.zip"
|
@@ -49,6 +49,8 @@ REQUIREMENTS_TXT = "requirements.txt"
|
|
49
49
|
PYPI_PACKAGE_DETAILS_URL = "https://pypi.org/pypi/fivetran_connector_sdk/json"
|
50
50
|
ONE_DAY_IN_SEC = 24 * 60 * 60
|
51
51
|
MAX_RETRIES = 3
|
52
|
+
LOGGING_PREFIX = "Fivetran-Connector-SDK"
|
53
|
+
LOGGING_DELIMITER = ": "
|
52
54
|
VIRTUAL_ENV_CONFIG = "pyvenv.cfg"
|
53
55
|
|
54
56
|
# Compile patterns used in the implementation
|
@@ -406,10 +408,7 @@ def map_defined_data_type(columns, k, mapped_data, v):
|
|
406
408
|
mapped_data[k] = common_pb2.ValueType(naive_datetime=timestamp)
|
407
409
|
elif columns[k].type == common_pb2.DataType.UTC_DATETIME:
|
408
410
|
timestamp = timestamp_pb2.Timestamp()
|
409
|
-
if
|
410
|
-
dt = datetime.strptime(v, "%Y-%m-%dT%H:%M:%S.%f%z")
|
411
|
-
else:
|
412
|
-
dt = datetime.strptime(v, "%Y-%m-%dT%H:%M:%S%z")
|
411
|
+
dt = v if isinstance(v, datetime) else _parse_datetime_str(v)
|
413
412
|
timestamp.FromDatetime(dt)
|
414
413
|
mapped_data[k] = common_pb2.ValueType(utc_datetime=timestamp)
|
415
414
|
elif columns[k].type == common_pb2.DataType.BINARY:
|
@@ -425,6 +424,10 @@ def map_defined_data_type(columns, k, mapped_data, v):
|
|
425
424
|
raise ValueError(f"Unsupported data type encountered: {columns[k].type}. Please use valid data types.")
|
426
425
|
|
427
426
|
|
427
|
+
def _parse_datetime_str(dt):
|
428
|
+
return datetime.strptime(dt, "%Y-%m-%dT%H:%M:%S.%f%z" if '.' in dt else "%Y-%m-%dT%H:%M:%S%z")
|
429
|
+
|
430
|
+
|
428
431
|
def _yield_check(stack):
|
429
432
|
"""Checks for the presence of 'yield' in the calling code.
|
430
433
|
Args:
|
@@ -527,9 +530,9 @@ def print_library_log(message: str, level: Logging.Level = Logging.Level.INFO):
|
|
527
530
|
if DEBUGGING or EXECUTED_VIA_CLI:
|
528
531
|
current_time = datetime.now().strftime("%b %d, %Y %I:%M:%S %p")
|
529
532
|
escaped_message = json.dumps(message).strip('"')
|
530
|
-
print(f"{current_time} {level.name}: {escaped_message}")
|
533
|
+
print(f"{current_time} {level.name} {LOGGING_PREFIX}: {escaped_message}")
|
531
534
|
else:
|
532
|
-
escaped_message = json.dumps(message)
|
535
|
+
escaped_message = json.dumps(LOGGING_PREFIX + LOGGING_DELIMITER + message)
|
533
536
|
log_message = f'{{"level":"{level.name}", "message": {escaped_message}, "message_origin": "library"}}'
|
534
537
|
print(log_message)
|
535
538
|
|
@@ -928,7 +931,7 @@ class Connector(connector_sdk_pb2_grpc.ConnectorServicer):
|
|
928
931
|
self.__update_connection(
|
929
932
|
args, connection_id, connection, group_name, connection_config, deploy_key, hd_agent_id)
|
930
933
|
print("✓")
|
931
|
-
print_library_log(f"
|
934
|
+
print_library_log(f"Connection ID: {connection_id}")
|
932
935
|
print_library_log(
|
933
936
|
f"Visit the Fivetran dashboard to manage the connection: https://fivetran.com/dashboard/connectors/{connection_id}/status")
|
934
937
|
else:
|
@@ -948,7 +951,7 @@ class Connector(connector_sdk_pb2_grpc.ConnectorServicer):
|
|
948
951
|
connection_id = response.json()['data']['id']
|
949
952
|
# Python Version is not passed into connection_config as default value will be picked up from ConnectorSdkCredentials.java class.
|
950
953
|
print_library_log(f"Python Version: {args.python_version if args.python_version else DEFAULT_PYTHON_VERSION}", Logging.Level.INFO)
|
951
|
-
print_library_log(f"
|
954
|
+
print_library_log(f"Connection ID: {connection_id}")
|
952
955
|
print_library_log(
|
953
956
|
f"Visit the Fivetran dashboard to start the initial sync: https://fivetran.com/dashboard/connectors/{connection_id}/status")
|
954
957
|
else:
|
@@ -989,13 +992,19 @@ class Connector(connector_sdk_pb2_grpc.ConnectorServicer):
|
|
989
992
|
if not args.configuration:
|
990
993
|
del config["secrets_list"]
|
991
994
|
|
995
|
+
json_payload = {
|
996
|
+
"config": config,
|
997
|
+
"run_setup_tests": True
|
998
|
+
}
|
999
|
+
|
1000
|
+
# hybrid_deployment_agent_id is optional when redeploying your connection.
|
1001
|
+
# Customer can use it to change existing hybrid_deployment_agent_id.
|
1002
|
+
if hd_agent_id:
|
1003
|
+
json_payload["hybrid_deployment_agent_id"] = hd_agent_id
|
1004
|
+
|
992
1005
|
response = rq.patch(f"{PRODUCTION_BASE_URL}/v1/connectors/{id}",
|
993
1006
|
headers={"Authorization": f"Basic {deploy_key}"},
|
994
|
-
json=
|
995
|
-
"config": config,
|
996
|
-
"hybrid_deployment_agent_id": hd_agent_id,
|
997
|
-
"run_setup_tests": True
|
998
|
-
})
|
1007
|
+
json=json_payload)
|
999
1008
|
|
1000
1009
|
if response.ok and response.status_code == HTTPStatus.OK:
|
1001
1010
|
if Connector.__are_setup_tests_failing(response):
|
@@ -1013,7 +1022,7 @@ class Connector(connector_sdk_pb2_grpc.ConnectorServicer):
|
|
1013
1022
|
print_library_log(log_message, Logging.Level.SEVERE)
|
1014
1023
|
Connector.__print_failing_setup_tests(resp)
|
1015
1024
|
connection_id = resp.json().get('data', {}).get('id')
|
1016
|
-
print_library_log(f"
|
1025
|
+
print_library_log(f"Connection ID: {connection_id}")
|
1017
1026
|
print_library_log("Please try again with the deploy command after resolving the issue!")
|
1018
1027
|
os._exit(1)
|
1019
1028
|
|
@@ -1,6 +1,6 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.4
|
2
2
|
Name: fivetran_connector_sdk
|
3
|
-
Version: 1.
|
3
|
+
Version: 1.3.0
|
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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|