File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -582,13 +582,16 @@ def _read_sql_athena_ctas(self,
582582 self ._session .glue .delete_table_if_exists (database = database , table = name )
583583 manifest_path : str = f"{ s3_output } /tables/{ query_id } -manifest.csv"
584584 paths : List [str ] = self ._session .athena .extract_manifest_paths (path = manifest_path )
585- if not paths :
586- return pd .DataFrame ()
587585 logger .debug (f"paths: { paths } " )
588- return self .read_parquet (path = paths ,
589- procs_cpu_bound = procs_cpu_bound ,
590- wait_objects = True ,
591- wait_objects_timeout = 15.0 )
586+ if not paths :
587+ df : pd .DataFrame = pd .DataFrame ()
588+ else :
589+ df = self .read_parquet (path = paths ,
590+ procs_cpu_bound = procs_cpu_bound ,
591+ wait_objects = True ,
592+ wait_objects_timeout = 15.0 )
593+ self ._session .s3 .delete_listed_objects (objects_paths = [manifest_path ] + paths )
594+ return df
592595
593596 def _read_sql_athena_regular (self ,
594597 sql : str ,
You can’t perform that action at this time.
0 commit comments