fivetran-connector-sdk 1.4.2__tar.gz → 1.4.4__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.4.2 → fivetran_connector_sdk-1.4.4}/PKG-INFO +1 -1
- {fivetran_connector_sdk-1.4.2 → fivetran_connector_sdk-1.4.4}/src/fivetran_connector_sdk/__init__.py +29 -27
- {fivetran_connector_sdk-1.4.2 → fivetran_connector_sdk-1.4.4}/src/fivetran_connector_sdk.egg-info/PKG-INFO +1 -1
- {fivetran_connector_sdk-1.4.2 → fivetran_connector_sdk-1.4.4}/README.md +0 -0
- {fivetran_connector_sdk-1.4.2 → fivetran_connector_sdk-1.4.4}/pyproject.toml +0 -0
- {fivetran_connector_sdk-1.4.2 → fivetran_connector_sdk-1.4.4}/setup.cfg +0 -0
- {fivetran_connector_sdk-1.4.2 → fivetran_connector_sdk-1.4.4}/src/fivetran_connector_sdk/protos/__init__.py +0 -0
- {fivetran_connector_sdk-1.4.2 → fivetran_connector_sdk-1.4.4}/src/fivetran_connector_sdk/protos/common_pb2.py +0 -0
- {fivetran_connector_sdk-1.4.2 → fivetran_connector_sdk-1.4.4}/src/fivetran_connector_sdk/protos/common_pb2.pyi +0 -0
- {fivetran_connector_sdk-1.4.2 → fivetran_connector_sdk-1.4.4}/src/fivetran_connector_sdk/protos/common_pb2_grpc.py +0 -0
- {fivetran_connector_sdk-1.4.2 → fivetran_connector_sdk-1.4.4}/src/fivetran_connector_sdk/protos/connector_sdk_pb2.py +0 -0
- {fivetran_connector_sdk-1.4.2 → fivetran_connector_sdk-1.4.4}/src/fivetran_connector_sdk/protos/connector_sdk_pb2.pyi +0 -0
- {fivetran_connector_sdk-1.4.2 → fivetran_connector_sdk-1.4.4}/src/fivetran_connector_sdk/protos/connector_sdk_pb2_grpc.py +0 -0
- {fivetran_connector_sdk-1.4.2 → fivetran_connector_sdk-1.4.4}/src/fivetran_connector_sdk.egg-info/SOURCES.txt +0 -0
- {fivetran_connector_sdk-1.4.2 → fivetran_connector_sdk-1.4.4}/src/fivetran_connector_sdk.egg-info/dependency_links.txt +0 -0
- {fivetran_connector_sdk-1.4.2 → fivetran_connector_sdk-1.4.4}/src/fivetran_connector_sdk.egg-info/entry_points.txt +0 -0
- {fivetran_connector_sdk-1.4.2 → fivetran_connector_sdk-1.4.4}/src/fivetran_connector_sdk.egg-info/requires.txt +0 -0
- {fivetran_connector_sdk-1.4.2 → fivetran_connector_sdk-1.4.4}/src/fivetran_connector_sdk.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: fivetran_connector_sdk
|
3
|
-
Version: 1.4.
|
3
|
+
Version: 1.4.4
|
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.4.2 → fivetran_connector_sdk-1.4.4}/src/fivetran_connector_sdk/__init__.py
RENAMED
@@ -32,13 +32,13 @@ from fivetran_connector_sdk.protos import connector_sdk_pb2_grpc
|
|
32
32
|
|
33
33
|
# Version format: <major_version>.<minor_version>.<patch_version>
|
34
34
|
# (where Major Version = 1 for GA, Minor Version is incremental MM from Jan 25 onwards, Patch Version is incremental within a month)
|
35
|
-
__version__ = "1.4.
|
35
|
+
__version__ = "1.4.4"
|
36
36
|
|
37
37
|
MAC_OS = "mac"
|
38
38
|
WIN_OS = "windows"
|
39
39
|
LINUX_OS = "linux"
|
40
40
|
|
41
|
-
TESTER_VERSION = "0.25.
|
41
|
+
TESTER_VERSION = "0.25.0515.001"
|
42
42
|
TESTER_FILENAME = "run_sdk_tester.jar"
|
43
43
|
VERSION_FILENAME = "version.txt"
|
44
44
|
UPLOAD_FILENAME = "code.zip"
|
@@ -84,8 +84,8 @@ INSTALLATION_SCRIPT = "installation.sh"
|
|
84
84
|
DRIVERS = "drivers"
|
85
85
|
JAVA_LONG_MAX_VALUE = 9223372036854775807
|
86
86
|
MAX_CONFIG_FIELDS = 100
|
87
|
-
SUPPORTED_PYTHON_VERSIONS = ["3.12
|
88
|
-
DEFAULT_PYTHON_VERSION = "3.12
|
87
|
+
SUPPORTED_PYTHON_VERSIONS = ["3.12", "3.11", "3.10", "3.9"]
|
88
|
+
DEFAULT_PYTHON_VERSION = "3.12"
|
89
89
|
FIVETRAN_HD_AGENT_ID = "FIVETRAN_HD_AGENT_ID"
|
90
90
|
UTF_8 = "utf-8"
|
91
91
|
|
@@ -324,8 +324,8 @@ def check_newer_version():
|
|
324
324
|
data = json.loads(response.text)
|
325
325
|
latest_version = data["info"]["version"]
|
326
326
|
if __version__ < latest_version:
|
327
|
-
print_library_log(f"[notice] A new release of 'fivetran-connector-sdk' is available: {latest_version}
|
328
|
-
|
327
|
+
print_library_log(f"[notice] A new release of 'fivetran-connector-sdk' is available: {latest_version}")
|
328
|
+
print_library_log("[notice] To update, run: pip install --upgrade fivetran-connector-sdk")
|
329
329
|
|
330
330
|
with open(last_check_file_path, 'w', encoding=UTF_8) as f_out:
|
331
331
|
f_out.write(f"{int(time.time())}")
|
@@ -555,7 +555,7 @@ def log_unused_deps_error(package_name: str, version: str):
|
|
555
555
|
f" Current version: {version}", Logging.Level.SEVERE)
|
556
556
|
|
557
557
|
|
558
|
-
def validate_deploy_parameters(connection, deploy_key
|
558
|
+
def validate_deploy_parameters(connection, deploy_key):
|
559
559
|
if not deploy_key or not connection:
|
560
560
|
print_library_log("The deploy command needs the following parameters:"
|
561
561
|
"\n\tRequired:\n"
|
@@ -570,10 +570,6 @@ def validate_deploy_parameters(connection, deploy_key, python_version):
|
|
570
570
|
f"underscore or a lowercase letter (a-z), followed by any combination of underscores, lowercase "
|
571
571
|
f"letters, or digits (0-9). Uppercase characters are not allowed.", Logging.Level.SEVERE)
|
572
572
|
os._exit(1)
|
573
|
-
elif python_version and python_version not in SUPPORTED_PYTHON_VERSIONS:
|
574
|
-
print_library_log(f"This Python version is not supported: {python_version}. "
|
575
|
-
f"We only support the following python versions: {SUPPORTED_PYTHON_VERSIONS} ", Logging.Level.SEVERE)
|
576
|
-
os._exit(1)
|
577
573
|
|
578
574
|
def print_library_log(message: str, level: Logging.Level = Logging.Level.INFO):
|
579
575
|
"""Logs a library message with the specified logging level.
|
@@ -844,6 +840,9 @@ class Connector(connector_sdk_pb2_grpc.ConnectorServicer):
|
|
844
840
|
for requirement in corrupt_requirements:
|
845
841
|
del tmp_requirements[requirement]
|
846
842
|
|
843
|
+
update_version_requirements = False
|
844
|
+
update_missing_requirements = False
|
845
|
+
update_unused_requirements = False
|
847
846
|
if len(tmp_requirements) > 0:
|
848
847
|
requirements = self.load_or_add_requirements_file(requirements_file_path)
|
849
848
|
|
@@ -857,8 +856,11 @@ class Connector(connector_sdk_pb2_grpc.ConnectorServicer):
|
|
857
856
|
confirm = input(
|
858
857
|
f"Would you like us to update {REQUIREMENTS_TXT} to the current stable versions of the dependent libraries? (Y/N):")
|
859
858
|
if confirm.lower() == "y":
|
859
|
+
update_version_requirements = True
|
860
860
|
for requirement in version_mismatch_deps:
|
861
861
|
requirements[requirement] = tmp_requirements[requirement]
|
862
|
+
elif confirm.lower() == "n":
|
863
|
+
print_library_log(f"Ignored the identified dependency version conflicts. These changes are NOT made to {REQUIREMENTS_TXT}")
|
862
864
|
|
863
865
|
missing_deps = {key: tmp_requirements[key] for key in (tmp_requirements.keys() - requirements.keys())}
|
864
866
|
if missing_deps:
|
@@ -867,9 +869,9 @@ class Connector(connector_sdk_pb2_grpc.ConnectorServicer):
|
|
867
869
|
confirm = input(
|
868
870
|
f"Would you like us to update {REQUIREMENTS_TXT} to add missing dependent libraries? (Y/N):")
|
869
871
|
if confirm.lower() == "n":
|
870
|
-
print_library_log(f"
|
871
|
-
os._exit(1)
|
872
|
+
print_library_log(f"Ignored dependencies identified as needed. These changes are NOT made to {REQUIREMENTS_TXT}. Please review the requirements as this can fail after deploy.")
|
872
873
|
elif confirm.lower() == "y":
|
874
|
+
update_missing_requirements = True
|
873
875
|
for requirement in missing_deps:
|
874
876
|
requirements[requirement] = tmp_requirements[requirement]
|
875
877
|
|
@@ -882,29 +884,28 @@ class Connector(connector_sdk_pb2_grpc.ConnectorServicer):
|
|
882
884
|
if 'fivetran_connector_sdk' in unused_deps or 'requests' in unused_deps:
|
883
885
|
print_library_log(f"Please fix your {REQUIREMENTS_TXT} file by removing pre-installed dependencies to proceed with deployment.")
|
884
886
|
os._exit(1)
|
887
|
+
print_library_log(f"Ignored libraries identified as unused. These changes are NOT made to {REQUIREMENTS_TXT}")
|
885
888
|
elif confirm.lower() == "y":
|
889
|
+
update_unused_requirements = True
|
886
890
|
for requirement in unused_deps:
|
887
891
|
del requirements[requirement]
|
888
892
|
|
889
893
|
|
890
|
-
if
|
891
|
-
if force:
|
892
|
-
requirements = tmp_requirements
|
893
|
-
|
894
|
+
if update_version_requirements or update_missing_requirements or update_unused_requirements:
|
894
895
|
with open(requirements_file_path, "w", encoding=UTF_8) as file:
|
895
896
|
file.write("\n".join(requirements.values()))
|
896
|
-
|
897
|
+
print_library_log(f"`{REQUIREMENTS_TXT}` has been updated successfully.")
|
897
898
|
|
898
899
|
else:
|
899
900
|
if os.path.exists(requirements_file_path):
|
900
|
-
print_library_log("
|
901
|
+
print_library_log(f"{REQUIREMENTS_TXT} is not required as no additional "
|
901
902
|
"Python libraries are required or all required libraries for "
|
902
903
|
"your code are pre-installed.", Logging.Level.WARNING)
|
903
904
|
with open(requirements_file_path, 'w') as file:
|
904
905
|
file.write("")
|
905
906
|
|
906
907
|
|
907
|
-
if is_deploy: print_library_log("
|
908
|
+
if is_deploy: print_library_log(f"Validation of {REQUIREMENTS_TXT} completed.")
|
908
909
|
|
909
910
|
def handle_unused_deps(self, unused_deps):
|
910
911
|
if 'fivetran_connector_sdk' in unused_deps:
|
@@ -964,7 +965,7 @@ class Connector(connector_sdk_pb2_grpc.ConnectorServicer):
|
|
964
965
|
|
965
966
|
print_library_log("We support only `.py` files and a `requirements.txt` file as part of the code upload. *No other code files* are supported or uploaded during the deployment process. Ensure that your code is structured accordingly and all dependencies are listed in `requirements.txt`")
|
966
967
|
|
967
|
-
validate_deploy_parameters(connection, deploy_key
|
968
|
+
validate_deploy_parameters(connection, deploy_key)
|
968
969
|
|
969
970
|
_check_dict(configuration, True)
|
970
971
|
|
@@ -979,10 +980,8 @@ class Connector(connector_sdk_pb2_grpc.ConnectorServicer):
|
|
979
980
|
"sync_method": "DIRECT"
|
980
981
|
}
|
981
982
|
|
982
|
-
# args.python_version is already validated in validate_deploy_parameters - so its safe to add in connection_config
|
983
983
|
if args.python_version:
|
984
984
|
connection_config["python_version"] = args.python_version
|
985
|
-
print_library_log(f"Python version {args.python_version} to be used at runtime.", Logging.Level.INFO)
|
986
985
|
|
987
986
|
self.validate_requirements_file(args.project_path, True, args.force)
|
988
987
|
|
@@ -1008,9 +1007,11 @@ class Connector(connector_sdk_pb2_grpc.ConnectorServicer):
|
|
1008
1007
|
print_library_log("Updating the connection...\n")
|
1009
1008
|
self.__upload_project(
|
1010
1009
|
args.project_path, deploy_key, group_id, group_name, connection)
|
1011
|
-
self.__update_connection(
|
1010
|
+
response = self.__update_connection(
|
1012
1011
|
args, connection_id, connection, group_name, connection_config, deploy_key, hd_agent_id)
|
1013
1012
|
print("✓")
|
1013
|
+
print_library_log(f"Python version {response.json()['data']['config']['python_version']} to be used at runtime.",
|
1014
|
+
Logging.Level.INFO)
|
1014
1015
|
print_library_log(f"Connection ID: {connection_id}")
|
1015
1016
|
print_library_log(
|
1016
1017
|
f"Visit the Fivetran dashboard to manage the connection: https://fivetran.com/dashboard/connectors/{connection_id}/status")
|
@@ -1029,8 +1030,8 @@ class Connector(connector_sdk_pb2_grpc.ConnectorServicer):
|
|
1029
1030
|
print_library_log(
|
1030
1031
|
f"The connection '{connection}' has been created successfully.\n")
|
1031
1032
|
connection_id = response.json()['data']['id']
|
1032
|
-
|
1033
|
-
|
1033
|
+
print_library_log(f"Python version {response.json()['data']['config']['python_version']} to be used at runtime.",
|
1034
|
+
Logging.Level.INFO)
|
1034
1035
|
print_library_log(f"Connection ID: {connection_id}")
|
1035
1036
|
print_library_log(
|
1036
1037
|
f"Visit the Fivetran dashboard to start the initial sync: https://fivetran.com/dashboard/connectors/{connection_id}/status")
|
@@ -1096,6 +1097,7 @@ class Connector(connector_sdk_pb2_grpc.ConnectorServicer):
|
|
1096
1097
|
print_library_log(
|
1097
1098
|
f"Unable to update Connection '{name}' in destination '{group}', failed with error: '{response.json()['message']}'.", Logging.Level.SEVERE)
|
1098
1099
|
os._exit(1)
|
1100
|
+
return response
|
1099
1101
|
|
1100
1102
|
@staticmethod
|
1101
1103
|
def __handle_failing_tests_message_and_exit(resp, log_message):
|
@@ -1896,7 +1898,7 @@ def main():
|
|
1896
1898
|
parser.add_argument("--destination", type=str, default=None, help="Destination name (aka 'group name')")
|
1897
1899
|
parser.add_argument("--connection", type=str, default=None, help="Connection name (aka 'destination schema')")
|
1898
1900
|
parser.add_argument("-f", "--force", action="store_true", help="Force update an existing connection")
|
1899
|
-
parser.add_argument("--python-version", "--python", type=str, help=f"Supported Python versions you can use: {SUPPORTED_PYTHON_VERSIONS}. Defaults to
|
1901
|
+
parser.add_argument("--python-version", "--python", type=str, help=f"Supported Python versions you can use: {SUPPORTED_PYTHON_VERSIONS}. Defaults to {DEFAULT_PYTHON_VERSION}")
|
1900
1902
|
parser.add_argument("--hybrid-deployment-agent-id", type=str, help="The Hybrid Deployment agent within the Fivetran system. If nothing is passed, the default agent of the destination is used.")
|
1901
1903
|
|
1902
1904
|
args = parser.parse_args()
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: fivetran_connector_sdk
|
3
|
-
Version: 1.4.
|
3
|
+
Version: 1.4.4
|
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
|