fivetran-connector-sdk 0.8.28.1__py3-none-any.whl → 0.9.4.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.
- fivetran_connector_sdk/__init__.py +23 -10
- {fivetran_connector_sdk-0.8.28.1.dist-info → fivetran_connector_sdk-0.9.4.1.dist-info}/METADATA +2 -2
- {fivetran_connector_sdk-0.8.28.1.dist-info → fivetran_connector_sdk-0.9.4.1.dist-info}/RECORD +6 -6
- {fivetran_connector_sdk-0.8.28.1.dist-info → fivetran_connector_sdk-0.9.4.1.dist-info}/WHEEL +1 -1
- {fivetran_connector_sdk-0.8.28.1.dist-info → fivetran_connector_sdk-0.9.4.1.dist-info}/entry_points.txt +0 -0
- {fivetran_connector_sdk-0.8.28.1.dist-info → fivetran_connector_sdk-0.9.4.1.dist-info}/top_level.txt +0 -0
@@ -1,4 +1,6 @@
|
|
1
1
|
import argparse
|
2
|
+
from typing import Optional
|
3
|
+
|
2
4
|
import grpc
|
3
5
|
import importlib.util
|
4
6
|
import inspect
|
@@ -23,7 +25,7 @@ from fivetran_connector_sdk.protos import common_pb2
|
|
23
25
|
from fivetran_connector_sdk.protos import connector_sdk_pb2
|
24
26
|
from fivetran_connector_sdk.protos import connector_sdk_pb2_grpc
|
25
27
|
|
26
|
-
__version__ = "0.
|
28
|
+
__version__ = "0.9.04.1"
|
27
29
|
|
28
30
|
MAC_OS = "mac"
|
29
31
|
WIN_OS = "windows"
|
@@ -416,6 +418,13 @@ def is_connection_name_valid(connection: str):
|
|
416
418
|
return pattern.match(connection)
|
417
419
|
|
418
420
|
|
421
|
+
def log_unused_deps_error(package_name: str, version: str):
|
422
|
+
print(f"ERROR: Please remove `{package_name}` from requirements.txt."
|
423
|
+
f" The latest version of `{package_name}` is always available when executing your code."
|
424
|
+
f" Current version: {version}")
|
425
|
+
os._exit(1)
|
426
|
+
|
427
|
+
|
419
428
|
class Connector(connector_sdk_pb2_grpc.ConnectorServicer):
|
420
429
|
def __init__(self, update, schema=None):
|
421
430
|
"""Initializes the Connector instance.
|
@@ -476,7 +485,7 @@ class Connector(connector_sdk_pb2_grpc.ConnectorServicer):
|
|
476
485
|
if not requirement or requirement.startswith("#"): # Skip empty lines and comments
|
477
486
|
continue
|
478
487
|
try:
|
479
|
-
key
|
488
|
+
key = re.split(r"==|>=|<=|>|<", requirement)[0]
|
480
489
|
requirements_dict[key.lower()] = requirement.lower()
|
481
490
|
except ValueError:
|
482
491
|
print(f"Error: Invalid requirement format: '{requirement}'")
|
@@ -501,6 +510,8 @@ class Connector(connector_sdk_pb2_grpc.ConnectorServicer):
|
|
501
510
|
|
502
511
|
tmp_requirements = self.fetch_requirements_as_dict(self, tmp_requirements_file_path)
|
503
512
|
tmp_requirements.pop("fivetran_connector_sdk")
|
513
|
+
if tmp_requirements.get('requests') is not None:
|
514
|
+
tmp_requirements.pop("requests")
|
504
515
|
os.remove(tmp_requirements_file_path)
|
505
516
|
|
506
517
|
if len(tmp_requirements) > 0:
|
@@ -535,16 +546,18 @@ class Connector(connector_sdk_pb2_grpc.ConnectorServicer):
|
|
535
546
|
unused_deps = list(requirements.keys() - tmp_requirements.keys())
|
536
547
|
if unused_deps:
|
537
548
|
if 'fivetran_connector_sdk' in unused_deps:
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
549
|
+
log_unused_deps_error("fivetran_connector_sdk", __version__)
|
550
|
+
elif 'requests' in unused_deps:
|
551
|
+
log_unused_deps_error("requests", "2.32.3")
|
552
|
+
else:
|
553
|
+
print("INFO: The following dependencies are not needed, "
|
554
|
+
"they are not used or already installed. Please remove them from requirements.txt:")
|
555
|
+
print(*unused_deps)
|
544
556
|
else:
|
545
557
|
if os.path.exists("requirements.txt"):
|
546
558
|
print("WARNING: `requirements.txt` is not required as no additional "
|
547
|
-
"Python libraries are required for
|
559
|
+
"Python libraries are required or all required libraries for "
|
560
|
+
"your code are pre-installed.")
|
548
561
|
|
549
562
|
if is_deploy: print("Successful validation of requirements.txt")
|
550
563
|
|
@@ -682,7 +695,7 @@ class Connector(connector_sdk_pb2_grpc.ConnectorServicer):
|
|
682
695
|
os._exit(1)
|
683
696
|
|
684
697
|
@staticmethod
|
685
|
-
def __get_connection_id(name: str, group: str, group_id: str, deploy_key: str) -> str
|
698
|
+
def __get_connection_id(name: str, group: str, group_id: str, deploy_key: str) -> Optional[str]:
|
686
699
|
"""Retrieves the connection ID for the specified connection schema name, group, and deployment key.
|
687
700
|
|
688
701
|
Args:
|
{fivetran_connector_sdk-0.8.28.1.dist-info → fivetran_connector_sdk-0.9.4.1.dist-info}/METADATA
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: fivetran_connector_sdk
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.9.4.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
|
@@ -12,7 +12,7 @@ Requires-Python: >=3.9
|
|
12
12
|
Description-Content-Type: text/markdown
|
13
13
|
Requires-Dist: grpcio ==1.60.1
|
14
14
|
Requires-Dist: grpcio-tools ==1.60.1
|
15
|
-
Requires-Dist: requests ==2.
|
15
|
+
Requires-Dist: requests ==2.32.3
|
16
16
|
Requires-Dist: get-pypi-latest-version ==0.0.12
|
17
17
|
Requires-Dist: pipreqs ==0.5.0
|
18
18
|
|
{fivetran_connector_sdk-0.8.28.1.dist-info → fivetran_connector_sdk-0.9.4.1.dist-info}/RECORD
RENAMED
@@ -1,4 +1,4 @@
|
|
1
|
-
fivetran_connector_sdk/__init__.py,sha256=
|
1
|
+
fivetran_connector_sdk/__init__.py,sha256=wM2ZiUq2CXdaBQ3mG8imwDo08DdQoMXnFthUmp8iNlM,58291
|
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-0.
|
10
|
-
fivetran_connector_sdk-0.
|
11
|
-
fivetran_connector_sdk-0.
|
12
|
-
fivetran_connector_sdk-0.
|
13
|
-
fivetran_connector_sdk-0.
|
9
|
+
fivetran_connector_sdk-0.9.4.1.dist-info/METADATA,sha256=XHL6CImFUpErVQErQTd1Pn_7AxAm5tJXXEqTqG0jOg4,2787
|
10
|
+
fivetran_connector_sdk-0.9.4.1.dist-info/WHEEL,sha256=uCRv0ZEik_232NlR4YDw4Pv3Ajt5bKvMH13NUU7hFuI,91
|
11
|
+
fivetran_connector_sdk-0.9.4.1.dist-info/entry_points.txt,sha256=uQn0KPnFlQmXJfxlk0tifdNsSXWfVlnAFzNqjXZM_xM,57
|
12
|
+
fivetran_connector_sdk-0.9.4.1.dist-info/top_level.txt,sha256=-_xk2MFY4psIh7jw1lJePMzFb5-vask8_ZtX-UzYWUI,23
|
13
|
+
fivetran_connector_sdk-0.9.4.1.dist-info/RECORD,,
|
File without changes
|
{fivetran_connector_sdk-0.8.28.1.dist-info → fivetran_connector_sdk-0.9.4.1.dist-info}/top_level.txt
RENAMED
File without changes
|