fivetran-connector-sdk 1.4.1__py3-none-any.whl → 1.4.3__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.
@@ -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.1"
35
+ __version__ = "1.4.3"
36
36
 
37
37
  MAC_OS = "mac"
38
38
  WIN_OS = "windows"
39
39
  LINUX_OS = "linux"
40
40
 
41
- TESTER_VERSION = "0.25.0424.001"
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"
@@ -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, python_version):
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"Please fix your {REQUIREMENTS_TXT} file to proceed with deployment.")
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 is_deploy and (version_mismatch_deps or missing_deps or unused_deps):
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
- print_library_log(f"`{REQUIREMENTS_TXT}` has been updated successfully")
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("`requirements.txt` is not required as no additional "
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("Successful validation of requirements.txt")
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, args.python_version)
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
- # Python Version is not passed into connection_config as default value will be picked up from ConnectorSdkCredentials.java class.
1033
- print_library_log(f"Python Version: {args.python_version if args.python_version else DEFAULT_PYTHON_VERSION}", Logging.Level.INFO)
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 3.12.8")
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.1
3
+ Version: 1.4.3
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
@@ -1,4 +1,4 @@
1
- fivetran_connector_sdk/__init__.py,sha256=22ATq-tnC_JYy2LUWh4yLWaTopg2v_gOah4k_10WoIQ,86407
1
+ fivetran_connector_sdk/__init__.py,sha256=_U6XQS1zBe3eibSKkicnWGvUMNXnPTCPWcM-S4DMweA,86598
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-1.4.1.dist-info/METADATA,sha256=F5N5tcF6rl-23TOZohrKyk8uELa5kadAYPE8XUFy7s0,2967
10
- fivetran_connector_sdk-1.4.1.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
11
- fivetran_connector_sdk-1.4.1.dist-info/entry_points.txt,sha256=uQn0KPnFlQmXJfxlk0tifdNsSXWfVlnAFzNqjXZM_xM,57
12
- fivetran_connector_sdk-1.4.1.dist-info/top_level.txt,sha256=-_xk2MFY4psIh7jw1lJePMzFb5-vask8_ZtX-UzYWUI,23
13
- fivetran_connector_sdk-1.4.1.dist-info/RECORD,,
9
+ fivetran_connector_sdk-1.4.3.dist-info/METADATA,sha256=OwZVptsnSZRgijKppSa-tJGjmanTDPw3QSX7pcPfKJg,2967
10
+ fivetran_connector_sdk-1.4.3.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
11
+ fivetran_connector_sdk-1.4.3.dist-info/entry_points.txt,sha256=uQn0KPnFlQmXJfxlk0tifdNsSXWfVlnAFzNqjXZM_xM,57
12
+ fivetran_connector_sdk-1.4.3.dist-info/top_level.txt,sha256=-_xk2MFY4psIh7jw1lJePMzFb5-vask8_ZtX-UzYWUI,23
13
+ fivetran_connector_sdk-1.4.3.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.3.1)
2
+ Generator: setuptools (80.7.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5