in lambda/python/rs_integration_function/redshift_data/api.py [0:0]
def is_statement_in_active_state(query_string):
active_states = ["SUBMITTED", "PICKED", "STARTED"]
for state in active_states:
response = redshift_data_api.list_statements(Status=state)
for statement in response["Statements"]:
if statement["QueryString"] == query_string:
return True
return False