fivetran-connector-sdk 0.6.6.1__tar.gz → 0.6.6.3__tar.gz
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-0.6.6.1/src/fivetran_connector_sdk.egg-info → fivetran_connector_sdk-0.6.6.3}/PKG-INFO +1 -1
- {fivetran_connector_sdk-0.6.6.1 → fivetran_connector_sdk-0.6.6.3}/pyproject.toml +1 -1
- {fivetran_connector_sdk-0.6.6.1 → fivetran_connector_sdk-0.6.6.3}/src/fivetran_connector_sdk/__init__.py +11 -27
- {fivetran_connector_sdk-0.6.6.1 → fivetran_connector_sdk-0.6.6.3/src/fivetran_connector_sdk.egg-info}/PKG-INFO +1 -1
- {fivetran_connector_sdk-0.6.6.1 → fivetran_connector_sdk-0.6.6.3}/LICENSE +0 -0
- {fivetran_connector_sdk-0.6.6.1 → fivetran_connector_sdk-0.6.6.3}/setup.cfg +0 -0
- {fivetran_connector_sdk-0.6.6.1 → fivetran_connector_sdk-0.6.6.3}/src/fivetran_connector_sdk/protos/__init__.py +0 -0
- {fivetran_connector_sdk-0.6.6.1 → fivetran_connector_sdk-0.6.6.3}/src/fivetran_connector_sdk/protos/common_pb2.py +0 -0
- {fivetran_connector_sdk-0.6.6.1 → fivetran_connector_sdk-0.6.6.3}/src/fivetran_connector_sdk/protos/common_pb2.pyi +0 -0
- {fivetran_connector_sdk-0.6.6.1 → fivetran_connector_sdk-0.6.6.3}/src/fivetran_connector_sdk/protos/common_pb2_grpc.py +0 -0
- {fivetran_connector_sdk-0.6.6.1 → fivetran_connector_sdk-0.6.6.3}/src/fivetran_connector_sdk/protos/connector_sdk_pb2.py +0 -0
- {fivetran_connector_sdk-0.6.6.1 → fivetran_connector_sdk-0.6.6.3}/src/fivetran_connector_sdk/protos/connector_sdk_pb2.pyi +0 -0
- {fivetran_connector_sdk-0.6.6.1 → fivetran_connector_sdk-0.6.6.3}/src/fivetran_connector_sdk/protos/connector_sdk_pb2_grpc.py +0 -0
- {fivetran_connector_sdk-0.6.6.1 → fivetran_connector_sdk-0.6.6.3}/src/fivetran_connector_sdk.egg-info/SOURCES.txt +0 -0
- {fivetran_connector_sdk-0.6.6.1 → fivetran_connector_sdk-0.6.6.3}/src/fivetran_connector_sdk.egg-info/dependency_links.txt +0 -0
- {fivetran_connector_sdk-0.6.6.1 → fivetran_connector_sdk-0.6.6.3}/src/fivetran_connector_sdk.egg-info/entry_points.txt +0 -0
- {fivetran_connector_sdk-0.6.6.1 → fivetran_connector_sdk-0.6.6.3}/src/fivetran_connector_sdk.egg-info/requires.txt +0 -0
- {fivetran_connector_sdk-0.6.6.1 → fivetran_connector_sdk-0.6.6.3}/src/fivetran_connector_sdk.egg-info/top_level.txt +0 -0
@@ -29,7 +29,7 @@ UPLOAD_FILENAME = "code.zip"
|
|
29
29
|
ROOT_LOCATION = ".ft_sdk_connector_tester"
|
30
30
|
OUTPUT_FILES_DIR = "files"
|
31
31
|
|
32
|
-
|
32
|
+
EXCLUDED_DIRS = ["__pycache__", "lib", "include", OUTPUT_FILES_DIR]
|
33
33
|
|
34
34
|
DEBUGGING = False
|
35
35
|
TABLES = {}
|
@@ -341,19 +341,6 @@ class Connector(connector_sdk_pb2_grpc.SourceConnectorServicer):
|
|
341
341
|
arcname = os.path.relpath(file_path, project_path)
|
342
342
|
zipf.write(file_path, arcname)
|
343
343
|
|
344
|
-
# with ZipFile(upload_filepath, 'w', ZIP_DEFLATED) as zip_file:
|
345
|
-
# for root, folders, files in os.walk(project_path):
|
346
|
-
# for folder_name in folders:
|
347
|
-
# if folder_name == OUTPUT_FILES_DIR: continue
|
348
|
-
# absolute_path = os.path.join(root, folder_name)
|
349
|
-
# relative_path = absolute_path.replace(project_path + os.sep, '')
|
350
|
-
# zip_file.write(absolute_path, relative_path)
|
351
|
-
# for file in files:
|
352
|
-
# if file in EXCLUDED_FILES: continue
|
353
|
-
# absolute_path = os.path.join(root, file)
|
354
|
-
# relative_path = absolute_path.replace(project_path + os.sep, '')
|
355
|
-
# zip_file.write(absolute_path, relative_path)
|
356
|
-
#
|
357
344
|
return upload_filepath
|
358
345
|
|
359
346
|
def __dir_walker(self, top):
|
@@ -361,10 +348,10 @@ class Connector(connector_sdk_pb2_grpc.SourceConnectorServicer):
|
|
361
348
|
for name in os.listdir(top):
|
362
349
|
path = os.path.join(top, name)
|
363
350
|
if os.path.isdir(path):
|
364
|
-
if name
|
351
|
+
if name not in EXCLUDED_DIRS:
|
365
352
|
dirs.append(name)
|
366
353
|
else:
|
367
|
-
if name
|
354
|
+
if name.endswith(".py") or name == "requirements.txt":
|
368
355
|
files.append(name)
|
369
356
|
|
370
357
|
yield top, files
|
@@ -403,7 +390,7 @@ class Connector(connector_sdk_pb2_grpc.SourceConnectorServicer):
|
|
403
390
|
headers={"Authorization": f"Basic {deploy_key}"})
|
404
391
|
|
405
392
|
if not resp.ok:
|
406
|
-
print(f"ERROR: Unable to fetch list of
|
393
|
+
print(f"ERROR: Unable to fetch list of destination names, status code = {resp.status_code}")
|
407
394
|
os._exit(1)
|
408
395
|
|
409
396
|
# TODO: Do we need to implement pagination?
|
@@ -416,14 +403,14 @@ class Connector(connector_sdk_pb2_grpc.SourceConnectorServicer):
|
|
416
403
|
return groups[0]['id'], groups[0]['name']
|
417
404
|
else:
|
418
405
|
if not group:
|
419
|
-
print("ERROR:
|
406
|
+
print("ERROR: Destination name is required when there are multiple destinations in the account")
|
420
407
|
os._exit(1)
|
421
408
|
|
422
409
|
for grp in groups:
|
423
410
|
if grp['name'] == group:
|
424
411
|
return grp['id'], grp['name']
|
425
412
|
|
426
|
-
print(f"ERROR: Specified
|
413
|
+
print(f"ERROR: Specified destination was not found in the account: {group}")
|
427
414
|
os._exit(1)
|
428
415
|
|
429
416
|
# Call this method to run the connector in production
|
@@ -669,9 +656,9 @@ def main():
|
|
669
656
|
# Optional (Not all of these are valid with every mutually exclusive option below)
|
670
657
|
parser.add_argument("--port", type=int, default=None, help="Provide port number to run gRPC server")
|
671
658
|
parser.add_argument("--state", type=str, default=None, help="Provide state as JSON string or file")
|
672
|
-
parser.add_argument("--configuration", type=str, default=None, help="Provide secrets as JSON
|
659
|
+
parser.add_argument("--configuration", type=str, default=None, help="Provide secrets as JSON file")
|
673
660
|
parser.add_argument("--deploy-key", type=str, default=None, help="Provide deploy key")
|
674
|
-
parser.add_argument("--
|
661
|
+
parser.add_argument("--destination", type=str, default=None, help="Destination name (aka 'group name')")
|
675
662
|
parser.add_argument("--connection", type=str, default=None, help="Connection name (aka 'destination schema')")
|
676
663
|
|
677
664
|
args = parser.parse_args()
|
@@ -679,10 +666,10 @@ def main():
|
|
679
666
|
connector_object = find_connector_object(args.project_path)
|
680
667
|
|
681
668
|
# Process optional args
|
682
|
-
ft_group = args.
|
669
|
+
ft_group = args.destination if args.destination else os.getenv('DESTINATION', None)
|
683
670
|
ft_connection = args.connection if args.connection else os.getenv('CONNECTION', None)
|
684
671
|
deploy_key = args.deploy_key if args.deploy_key else os.getenv('DEPLOY_KEY', None)
|
685
|
-
configuration = args.configuration if args.configuration else
|
672
|
+
configuration = args.configuration if args.configuration else None
|
686
673
|
state = args.state if args.state else os.getenv('STATE', None)
|
687
674
|
|
688
675
|
if configuration:
|
@@ -691,10 +678,7 @@ def main():
|
|
691
678
|
with open(json_filepath, 'r') as fi:
|
692
679
|
configuration = json.load(fi)
|
693
680
|
else:
|
694
|
-
|
695
|
-
configuration = json.loads(configuration)
|
696
|
-
else:
|
697
|
-
raise ValueError("Unrecognized format for configuration")
|
681
|
+
raise ValueError("Configuration is not a JSON file")
|
698
682
|
else:
|
699
683
|
configuration = {}
|
700
684
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|