fivetran-connector-sdk 0.6.12.1__py3-none-any.whl → 0.7.11.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
 
@@ -751,8 +770,12 @@ def main():
751
770
  connector_object.debug(args.project_path, port, configuration, state)
752
771
 
753
772
  elif args.command.lower() == "run":
754
- port = 50051 if not args.port else args.port
755
- connector_object.run(port, configuration, state)
773
+ try:
774
+ port = 50051 if not args.port else args.port
775
+ connector_object.run(port, configuration, state)
776
+ except:
777
+ Logging.severe(traceback.format_exc())
778
+ os._exit(1)
756
779
 
757
780
  else:
758
781
  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.11.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=_7Qod37ieZGNBHMAhP24NruYYfGslYGvWfB5yEijpgM,32433
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.11.1.dist-info/LICENSE,sha256=Kutp3D0T7HmHuBifKmbw39OZLAL1ckaLRb8u9lyJxE8,1065
10
+ fivetran_connector_sdk-0.7.11.1.dist-info/METADATA,sha256=EGLYjY4_99VeElrHLDiTNp7qf8Yf-zfYv38gnO5p-fU,651
11
+ fivetran_connector_sdk-0.7.11.1.dist-info/WHEEL,sha256=Z4pYXqR_rTB7OWNDYFOm1qRk0RX6GFP2o8LgvP453Hk,91
12
+ fivetran_connector_sdk-0.7.11.1.dist-info/entry_points.txt,sha256=uQn0KPnFlQmXJfxlk0tifdNsSXWfVlnAFzNqjXZM_xM,57
13
+ fivetran_connector_sdk-0.7.11.1.dist-info/top_level.txt,sha256=-_xk2MFY4psIh7jw1lJePMzFb5-vask8_ZtX-UzYWUI,23
14
+ fivetran_connector_sdk-0.7.11.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.43.0)
2
+ Generator: setuptools (70.3.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5