-
Notifications
You must be signed in to change notification settings - Fork 80
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
Commands datatype table #183
Conversation
Note that this commit ports over the contents of the previously existing repository. Fixes qiita-spots#59
@@ -107,7 +107,7 @@ def _sql_executor(self, sql, sql_args=None, many=False): | |||
err_sql = cur.mogrify(sql, sql_args) | |||
else: | |||
err_sql = cur.mogrify(sql, sql_args[0]) | |||
except IndexError: | |||
except (IndexError, TypeError): |
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.
In what context would a TypeError
be raised above?
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.
in case that sql_args
is None
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.
In that case, i think this try/except
can be replaced with:
if sql_args and sql_args[0] and isinstance(sql_args[0], Iterable):
err_sql = cur.mogrify(sql, sql_args[0])
else:
err_sql = cur.mogrify(sql, sql_args)
right?
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.
Uhm... That should work.
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.
you could even remove the and sql_args[0]
part of the if
clause, i think
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.
Sounds good, fix pushed.
Looks good to me, anyone else so we can merge? |
After that comment about the nested try/excepts is addressed, I give it the 👍 |
This is ready to merge. |
This adds a join table that links a command up to the datatypes it can be run on. Needed so we can programmatically populate the commands selection for each datatype.