From 8334e3f82d830fe590f559cd0559674ef1e4cecf Mon Sep 17 00:00:00 2001 From: Gavin Paes <40449248+gavinpaes@users.noreply.github.com> Date: Fri, 22 May 2020 15:02:01 -0600 Subject: [PATCH] Ensure lowercase column names before column differential check This change fixes Issue #18 by ensuring column names are lowercased before column differential check. --- operators/s3_to_redshift_operator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/operators/s3_to_redshift_operator.py b/operators/s3_to_redshift_operator.py index 194260b..c5e33dc 100644 --- a/operators/s3_to_redshift_operator.py +++ b/operators/s3_to_redshift_operator.py @@ -187,7 +187,7 @@ def reconcile_schemas(self, schema, pg_hook): """.format(self.redshift_schema, self.table) pg_schema = dict(pg_hook.get_records(pg_query)) - incoming_keys = [column['name'] for column in schema] + incoming_keys = [column['name'].lower() for column in schema] diff = list(set(incoming_keys) - set(pg_schema.keys())) print(diff) # Check length of column differential to see if any new columns exist