-
Couldn't load subscription status.
- Fork 9
Add handling for single queries with semicolon #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Add handling for single queries with semicolon #8
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See some comments 🙏🏼
main.py
Outdated
| load_dotenv() # only on local run | ||
| print(os.environ) | ||
| queries_list = os.environ['INPUT_QUERIES'].split(';') | ||
| queries_list = map(str.strip, os.environ['INPUT_QUERIES'].split(';')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for safety to get rid of unnecessary whitespace
main.py
Outdated
| if query: | ||
| query_result = con.query(query) | ||
| query_results.append(query_result) | ||
| print("### Running query ###") | ||
| print(f"[!] Query id - {query_result.query_id}") | ||
| print(f"[!] Running query ### - {query}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps just filter out any None or empty query from queries_list instead of duplicating this if twice?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So you'd find it cleaner if we used filter when generating the queries_list?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Orca Security Scan Summary
| Status | Check | Issues by priority | |
|---|---|---|---|
| Infrastructure as Code | View in Orca | ||
| SAST | View in Orca | ||
| Secrets | View in Orca | ||
| Vulnerabilities | View in Orca |
@dluftspring sorry to let you down, but we're not maintaining this one anymore since we're not at @anecdotes-ai anymore. You'll need someone from the team to review it -- I'll try to ping someone |
Description
👋 Just throwing this up here for review as I think I ran into a single query error using this action. My read is that when you pass a single query trying to split on the
;causes an empty string to be sent to snowflake which then throws an error on the action. If you'd prefer to just document this behaviour as opposed to introducing new code that makes sense but I thought I would propose these changes as a suggestion