From 819bf7abf347354530900e0bed51217bff4dac35 Mon Sep 17 00:00:00 2001 From: Ari Brown Date: Fri, 26 Jan 2024 11:48:35 -0500 Subject: [PATCH] fixed dataset aggregation; typo; and a bad empty string check --- examples/cancel_queries.py | 3 +++ minerva/athena.py | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/examples/cancel_queries.py b/examples/cancel_queries.py index 15c8e82..b92de65 100644 --- a/examples/cancel_queries.py +++ b/examples/cancel_queries.py @@ -10,6 +10,9 @@ with open(file, 'r') as f: txt = f.read() for line in txt.split("\n"): + if not line.strip(): + continue + print(line) athena.cancel(line) diff --git a/minerva/athena.py b/minerva/athena.py index e35b409..66bc7e1 100644 --- a/minerva/athena.py +++ b/minerva/athena.py @@ -282,7 +282,7 @@ class Parallelize: def results(self): self.finish() - return pa.dataset.dataset([q.results().files for q in self.queries]) + return pa.dataset.dataset([f for q in self.queries for f in q.results().files]) def union_tables(self, dest): @@ -292,8 +292,8 @@ class Parallelize: tables = ' union all '.join(lines) out = os.path.join(self.athena.output, dest) - sql = load_sql(self.UNION_TABLES, dest = dest, - output = out, - tables = tables) + sql = load_template(self.UNION_TABLES, dest = dest, + output = out, + tables = tables) return self.athena.execute(sql)