From f730d4e41216a3b6ef50c3e54ec38f45b9d748c8 Mon Sep 17 00:00:00 2001 From: Yannis Roussos Date: Tue, 5 Nov 2019 15:20:12 +0200 Subject: [PATCH] Add a clear warning when non csv files are provided --- tap_csv/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tap_csv/__init__.py b/tap_csv/__init__.py index 07f9b2c..fdc2a79 100644 --- a/tap_csv/__init__.py +++ b/tap_csv/__init__.py @@ -35,7 +35,7 @@ def write_schema_from_header(entity, header, keys): def process_file(fileInfo): #determines if file in question is a file or directory and processes accordingly if not os.path.exists(fileInfo["file"]): - logger.info("Directory " + fileInfo["file"] + " does not exist, skipping") + logger.info(fileInfo["file"] + " does not exist, skipping") return if os.path.isdir(fileInfo["file"]): fileInfo["file"] = os.path.normpath(fileInfo["file"]) + os.sep #ensures directories end with trailing slash @@ -50,6 +50,7 @@ def process_file(fileInfo): def sync_file(fileInfo): if fileInfo["file"][-4:] != ".csv": logger.info("Skipping non-csv file '" + fileInfo["file"] + "'") + logger.info("Please provide a CSV file that ends with '.csv'; e.g. 'users.csv'") return logger.info("Syncing entity '" + fileInfo["entity"] + "' from file: '" + fileInfo["file"] + "'")