diff --git a/superset/db_engine_specs.py b/superset/db_engine_specs.py index cbcc570934345..eb3b3681eb34d 100644 --- a/superset/db_engine_specs.py +++ b/superset/db_engine_specs.py @@ -744,6 +744,12 @@ def handle_cursor(cls, cursor, query, session): break if stats: + state = stats.get('state') + + # if already finished, then stop polling + if state == 'FINISHED': + break + completed_splits = float(stats.get('completedSplits')) total_splits = float(stats.get('totalSplits')) if total_splits and completed_splits: