fivetran-connector-sdk 0.6.12.1__py3-none-any.whl → 0.7.18.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.
@@ -24,7 +24,7 @@ MAC_OS = "mac"
24
24
  WIN_OS = "windows"
25
25
  LINUX_OS = "linux"
26
26
 
27
- TESTER_VERSION = "0.24.0408.001"
27
+ TESTER_VERSION = "0.24.0711.001"
28
28
  TESTER_FILENAME = "sdk_connector_tester.jar"
29
29
  VERSION_FILENAME = "version.txt"
30
30
  UPLOAD_FILENAME = "code.zip"
@@ -37,6 +37,27 @@ DEBUGGING = False
37
37
  TABLES = {}
38
38
 
39
39
 
40
+ class Logging:
41
+ @staticmethod
42
+ def __log(level: str, message: str):
43
+ if DEBUGGING:
44
+ print(message)
45
+ else:
46
+ print(f'{{"level":"{level}", "message": "{message}", "message-origin": "connector_sdk"}}')
47
+
48
+ @staticmethod
49
+ def info(message: str):
50
+ Logging.__log("INFO", message)
51
+
52
+ @staticmethod
53
+ def warning(message: str):
54
+ Logging.__log("WARNING", message)
55
+
56
+ @staticmethod
57
+ def severe(message: str):
58
+ Logging.__log("SEVERE", message)
59
+
60
+
40
61
  class Operations:
41
62
  @staticmethod
42
63
  def upsert(table: str, data: dict) -> list[connector_sdk_pb2.UpdateResponse]:
@@ -441,8 +462,6 @@ class Connector(connector_sdk_pb2_grpc.ConnectorServicer):
441
462
 
442
463
  # Call this method to run the connector in production
443
464
  def run(self, port: int = 50051, configuration: dict = None, state: dict = None) -> grpc.Server:
444
- global DEBUGGING
445
-
446
465
  self.configuration = _check_dict(configuration, True)
447
466
  self.state = _check_dict(state)
448
467
 
@@ -469,9 +488,10 @@ class Connector(connector_sdk_pb2_grpc.ConnectorServicer):
469
488
  # Check version number & update if different
470
489
  with open(version_file, 'r') as fi:
471
490
  current_version = fi.readline()
472
- if current_version != TESTER_VERSION:
473
- shutil.rmtree(tester_root_dir)
474
- install_tester = True
491
+
492
+ if current_version != TESTER_VERSION:
493
+ shutil.rmtree(tester_root_dir)
494
+ install_tester = True
475
495
  else:
476
496
  install_tester = True
477
497
 
@@ -751,8 +771,12 @@ def main():
751
771
  connector_object.debug(args.project_path, port, configuration, state)
752
772
 
753
773
  elif args.command.lower() == "run":
754
- port = 50051 if not args.port else args.port
755
- connector_object.run(port, configuration, state)
774
+ try:
775
+ port = 50051 if not args.port else args.port
776
+ connector_object.run(port, configuration, state)
777
+ except:
778
+ Logging.severe(traceback.format_exc())
779
+ os._exit(1)
756
780
 
757
781
  else:
758
782
  raise NotImplementedError("Invalid command: ", args.command)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fivetran_connector_sdk
3
- Version: 0.6.12.1
3
+ Version: 0.7.18.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
@@ -1,4 +1,4 @@
1
- fivetran_connector_sdk/__init__.py,sha256=F7XxrvSpYhZobn2nz5T2txOcBTvBWZNabPlvK9a2CiI,31837
1
+ fivetran_connector_sdk/__init__.py,sha256=IIdg6sogef87he8tij10qYJAG9n4S9EJIfJSZoBILQg,32422
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,9 +6,9 @@ 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.6.12.1.dist-info/LICENSE,sha256=Kutp3D0T7HmHuBifKmbw39OZLAL1ckaLRb8u9lyJxE8,1065
10
- fivetran_connector_sdk-0.6.12.1.dist-info/METADATA,sha256=AYOF1IEr8YXzlvM7w493KJDc_OPhzlvyEN7lr_FmDaE,651
11
- fivetran_connector_sdk-0.6.12.1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
12
- fivetran_connector_sdk-0.6.12.1.dist-info/entry_points.txt,sha256=uQn0KPnFlQmXJfxlk0tifdNsSXWfVlnAFzNqjXZM_xM,57
13
- fivetran_connector_sdk-0.6.12.1.dist-info/top_level.txt,sha256=-_xk2MFY4psIh7jw1lJePMzFb5-vask8_ZtX-UzYWUI,23
14
- fivetran_connector_sdk-0.6.12.1.dist-info/RECORD,,
9
+ fivetran_connector_sdk-0.7.18.1.dist-info/LICENSE,sha256=Kutp3D0T7HmHuBifKmbw39OZLAL1ckaLRb8u9lyJxE8,1065
10
+ fivetran_connector_sdk-0.7.18.1.dist-info/METADATA,sha256=vgrh9es8KnNBY2Z9_3PpV_XD0e3ZNj4TZyp1BBRxkiE,651
11
+ fivetran_connector_sdk-0.7.18.1.dist-info/WHEEL,sha256=FZ75kcLy9M91ncbIgG8dnpCncbiKXSRGJ_PFILs6SFg,91
12
+ fivetran_connector_sdk-0.7.18.1.dist-info/entry_points.txt,sha256=uQn0KPnFlQmXJfxlk0tifdNsSXWfVlnAFzNqjXZM_xM,57
13
+ fivetran_connector_sdk-0.7.18.1.dist-info/top_level.txt,sha256=-_xk2MFY4psIh7jw1lJePMzFb5-vask8_ZtX-UzYWUI,23
14
+ fivetran_connector_sdk-0.7.18.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.43.0)
2
+ Generator: setuptools (71.0.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5