fivetran-connector-sdk 2.1.1__py3-none-any.whl → 2.2.0__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.
- fivetran_connector_sdk/__init__.py +15 -3
- fivetran_connector_sdk/operations.py +8 -8
- {fivetran_connector_sdk-2.1.1.dist-info → fivetran_connector_sdk-2.2.0.dist-info}/METADATA +3 -3
- {fivetran_connector_sdk-2.1.1.dist-info → fivetran_connector_sdk-2.2.0.dist-info}/RECORD +7 -7
- {fivetran_connector_sdk-2.1.1.dist-info → fivetran_connector_sdk-2.2.0.dist-info}/WHEEL +0 -0
- {fivetran_connector_sdk-2.1.1.dist-info → fivetran_connector_sdk-2.2.0.dist-info}/entry_points.txt +0 -0
- {fivetran_connector_sdk-2.1.1.dist-info → fivetran_connector_sdk-2.2.0.dist-info}/top_level.txt +0 -0
@@ -8,6 +8,7 @@ import traceback
|
|
8
8
|
import requests as rq
|
9
9
|
import threading
|
10
10
|
import queue
|
11
|
+
import subprocess
|
11
12
|
from types import GeneratorType
|
12
13
|
from http import HTTPStatus
|
13
14
|
from zipfile import ZipFile
|
@@ -42,7 +43,7 @@ from fivetran_connector_sdk.connector_helper import (
|
|
42
43
|
|
43
44
|
# Version format: <major_version>.<minor_version>.<patch_version>
|
44
45
|
# (where Major Version = 2, Minor Version is incremental MM from Aug 25 onwards, Patch Version is incremental within a month)
|
45
|
-
__version__ = "2.
|
46
|
+
__version__ = "2.2.0"
|
46
47
|
TESTER_VERSION = TESTER_VER
|
47
48
|
MAX_MESSAGE_LENGTH = 32 * 1024 * 1024 # 32MB
|
48
49
|
|
@@ -299,8 +300,12 @@ class Connector(connector_sdk_pb2_grpc.SourceConnectorServicer):
|
|
299
300
|
print_library_log("Running connector tester...")
|
300
301
|
for log_msg in run_tester(java_exe, tester_root_dir, project_path, available_port, json.dumps(self.state), json.dumps(self.configuration)):
|
301
302
|
print(log_msg, end="")
|
302
|
-
except:
|
303
|
+
except subprocess.CalledProcessError as e:
|
303
304
|
print(traceback.format_exc())
|
305
|
+
raise e
|
306
|
+
except Exception as e:
|
307
|
+
print(traceback.format_exc())
|
308
|
+
raise e
|
304
309
|
finally:
|
305
310
|
server.stop(grace=2.0)
|
306
311
|
|
@@ -486,7 +491,14 @@ def main():
|
|
486
491
|
elif args.command.lower() == "debug":
|
487
492
|
configuration, config_path = get_configuration(args)
|
488
493
|
state = get_state(args)
|
489
|
-
|
494
|
+
try:
|
495
|
+
connector_object.debug(args.project_path, configuration, state)
|
496
|
+
except subprocess.CalledProcessError as e:
|
497
|
+
print_library_log(f"Connector tester failed with exit code: {e.returncode}", Logging.Level.SEVERE)
|
498
|
+
sys.exit(e.returncode)
|
499
|
+
except Exception as e:
|
500
|
+
print_library_log(f"Debug command failed: {str(e)}", Logging.Level.SEVERE)
|
501
|
+
sys.exit(1)
|
490
502
|
else:
|
491
503
|
if not suggest_correct_command(args.command):
|
492
504
|
raise NotImplementedError(f"Invalid command: {args.command}, see `fivetran --help`")
|
@@ -181,20 +181,20 @@ def _map_data_to_columns(data: dict, columns: dict, table: str = "") -> dict:
|
|
181
181
|
|
182
182
|
def map_inferred_data_type(k, mapped_data, v, table=""):
|
183
183
|
# We can infer type from the value
|
184
|
-
if isinstance(v,
|
185
|
-
|
186
|
-
|
187
|
-
else:
|
188
|
-
mapped_data[k] = common_pb2.ValueType(long=v)
|
189
|
-
if _LOG_DATA_TYPE_INFERENCE.get("boolean_" + table, True) and isinstance(v, bool):
|
184
|
+
if isinstance(v, bool):
|
185
|
+
mapped_data[k] = common_pb2.ValueType(bool=v)
|
186
|
+
if _LOG_DATA_TYPE_INFERENCE.get("boolean_" + table, True):
|
190
187
|
print_library_log("Fivetran: Boolean Datatype has been inferred for " + table, Logging.Level.INFO, True)
|
191
188
|
if not _get_table_pk(table):
|
192
189
|
print_library_log("Fivetran: Boolean Datatype inference issue for " + table, Logging.Level.INFO, True)
|
193
190
|
_LOG_DATA_TYPE_INFERENCE["boolean_" + table] = False
|
191
|
+
elif isinstance(v, int):
|
192
|
+
if abs(v) > JAVA_LONG_MAX_VALUE:
|
193
|
+
mapped_data[k] = common_pb2.ValueType(float=v)
|
194
|
+
else:
|
195
|
+
mapped_data[k] = common_pb2.ValueType(long=v)
|
194
196
|
elif isinstance(v, float):
|
195
197
|
mapped_data[k] = common_pb2.ValueType(float=v)
|
196
|
-
elif isinstance(v, bool):
|
197
|
-
mapped_data[k] = common_pb2.ValueType(bool=v)
|
198
198
|
elif isinstance(v, bytes):
|
199
199
|
mapped_data[k] = common_pb2.ValueType(binary=v)
|
200
200
|
elif isinstance(v, list):
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: fivetran_connector_sdk
|
3
|
-
Version: 2.
|
3
|
+
Version: 2.2.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
|
@@ -11,8 +11,8 @@ Classifier: License :: OSI Approved :: MIT License
|
|
11
11
|
Classifier: Operating System :: OS Independent
|
12
12
|
Requires-Python: >=3.9
|
13
13
|
Description-Content-Type: text/markdown
|
14
|
-
Requires-Dist: grpcio==1.
|
15
|
-
Requires-Dist: grpcio-tools==1.
|
14
|
+
Requires-Dist: grpcio==1.74.0
|
15
|
+
Requires-Dist: grpcio-tools==1.74.0
|
16
16
|
Requires-Dist: requests==2.32.5
|
17
17
|
Requires-Dist: pipreqs-fivetran==1.0.1
|
18
18
|
Requires-Dist: prompt-toolkit==3.0.51
|
@@ -1,10 +1,10 @@
|
|
1
|
-
fivetran_connector_sdk/__init__.py,sha256=
|
1
|
+
fivetran_connector_sdk/__init__.py,sha256=752T93_hsRW9xVcWQJSTdEzksjZcjYmp6vnn5p9pdz8,23165
|
2
2
|
fivetran_connector_sdk/connector_helper.py,sha256=5htWpBLA56fx_f6LTfkhyIEY5onJ2eGDBo_6QiKxqqg,43023
|
3
3
|
fivetran_connector_sdk/constants.py,sha256=o-qDH9SoCj7kK6ArW3hHVaEYqn2L0rYgDyTiEruON7U,2441
|
4
4
|
fivetran_connector_sdk/helpers.py,sha256=7YVB1JQ9T0hg90Z0pjJxFp0pQzeBfefrfvS4SYtrlv4,15254
|
5
5
|
fivetran_connector_sdk/logger.py,sha256=ud8v8-mKx65OAPaZvxBqt2-CU0vjgBeiYwuiqsYh_hA,3063
|
6
6
|
fivetran_connector_sdk/operation_stream.py,sha256=DXLDv961xZ_GVSEPUFLtZy0IEf_ayQSEXFpEJp-CAu4,6194
|
7
|
-
fivetran_connector_sdk/operations.py,sha256=
|
7
|
+
fivetran_connector_sdk/operations.py,sha256=1NZjgP_DGLh6103aki2OHfeloPhXfLwtRaN7NIMRQbE,12300
|
8
8
|
fivetran_connector_sdk/protos/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
9
9
|
fivetran_connector_sdk/protos/common_pb2.py,sha256=zkzs6Rd-lvsev6Nsq37xc4HLJZ_uNXPkotCLY7Y7i5U,8770
|
10
10
|
fivetran_connector_sdk/protos/common_pb2.pyi,sha256=FdqlPKRqiXdUDT3e7adP5X42_Qzv_ItydUNJFKnJJIE,11478
|
@@ -12,8 +12,8 @@ fivetran_connector_sdk/protos/common_pb2_grpc.py,sha256=qni6h6BoA1nwJXr2bNtznfTk
|
|
12
12
|
fivetran_connector_sdk/protos/connector_sdk_pb2.py,sha256=Inv87MlK5Q56GNvMNFQHyqIePDMKnkW9y_BrT9DgPck,7835
|
13
13
|
fivetran_connector_sdk/protos/connector_sdk_pb2.pyi,sha256=3AC-bK6ZM-Bmr_RETOB3y_0u4ATWlwcbHzqVanDuOB0,8115
|
14
14
|
fivetran_connector_sdk/protos/connector_sdk_pb2_grpc.py,sha256=bGlvc_vGwA9-FTqrj-BYlVcA-7jS8A9MSZ-XpZFytvY,8795
|
15
|
-
fivetran_connector_sdk-2.
|
16
|
-
fivetran_connector_sdk-2.
|
17
|
-
fivetran_connector_sdk-2.
|
18
|
-
fivetran_connector_sdk-2.
|
19
|
-
fivetran_connector_sdk-2.
|
15
|
+
fivetran_connector_sdk-2.2.0.dist-info/METADATA,sha256=csqr6PWg7rPRC92gYPhUzyPbHu9H38DCpueIUOI0FOE,3197
|
16
|
+
fivetran_connector_sdk-2.2.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
17
|
+
fivetran_connector_sdk-2.2.0.dist-info/entry_points.txt,sha256=uQn0KPnFlQmXJfxlk0tifdNsSXWfVlnAFzNqjXZM_xM,57
|
18
|
+
fivetran_connector_sdk-2.2.0.dist-info/top_level.txt,sha256=-_xk2MFY4psIh7jw1lJePMzFb5-vask8_ZtX-UzYWUI,23
|
19
|
+
fivetran_connector_sdk-2.2.0.dist-info/RECORD,,
|
File without changes
|
{fivetran_connector_sdk-2.1.1.dist-info → fivetran_connector_sdk-2.2.0.dist-info}/entry_points.txt
RENAMED
File without changes
|
{fivetran_connector_sdk-2.1.1.dist-info → fivetran_connector_sdk-2.2.0.dist-info}/top_level.txt
RENAMED
File without changes
|