Skip to content

Commit

Permalink
Done
Browse files Browse the repository at this point in the history
  • Loading branch information
shahargl committed Sep 26, 2021
1 parent 346b92f commit 0dd474b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ inputs:
queries:
description: 'List of SQL queries, seperated by ;'
required: true
sync:
description: 'Whether to run the queries sync (default is async)'
required: false

outputs:
queries_results:
Expand Down
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def main():
print("### Running query ###")
print(f"[!] Query id - {query_result.query_id}")
print(f"[!] Running query ### - {query}")
json_results[query_result.query_id] = query_result.fetch_all()
json_results[query_result.query_id] = query_result.fetch_results_sync()

utils.set_github_action_output('queries_results', json.dumps(json_results))

Expand Down
6 changes: 5 additions & 1 deletion snowflake_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,8 @@ async def fetch_results(self):
while self.is_query_running():
await asyncio.sleep(0.1)

return self._fetch_results()
return self._fetch_results()

def fetch_results_sync(self):
self.cursor.get_results_from_sfqid(self.query_id)
return self.cursor.fetchall()

0 comments on commit 0dd474b

Please sign in to comment.