-
Notifications
You must be signed in to change notification settings - Fork 182
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
READY: RTS-667 / RTS-796 #422
Conversation
…feature to interpolate table name in queries if "{table}" is in query string.
req.query.base = str_to_bytes(query) | ||
|
||
q = query | ||
if '{table}' in q: |
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.
This is a new feature that I don't necessarily have to include. It eliminates the redundancy of specifying the table name as the first parameter to ts_query()
as well as within the query string. However, if the query string is itself a format string, the user must remember to escape the parameter via {{table}}
as you can see in the tests.
Looks like these were failing with TS 1.0 and the Python 2.3.0 client, too |
@javajolt - really? I'll give that a try. I know they worked at one point with a 1.0 RC. |
@@ -213,6 +214,58 @@ def validate_data(self, ts_obj): | |||
self.assertEqual(row[3], 'wind') | |||
self.assertIsNone(row[4]) | |||
|
|||
def test_query_that_creates_table_using_interpolation(self): |
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 is this interpolation because of the random table names?
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.
No, because I have {table}
in the query string, but do not use fmt
to replace it before passing to ts_query
. Within the code for queries, it will check for {table}
and, if present, insert the table name.
Note that ts_query
takes a table
parameter than can be a Table
object or a string. Either can provide the name of the table so it is convenient to replace the table name for the user.
See my comment here:
https://github.com/basho/riak-python-client/pull/422/files#r48791174
@javajolt TS tests pass this morning with RC7 |
👍 6f169a7 |
READY: RTS-667 / RTS-796 Reviewed-by: javajolt
@borshop merge |
DESCRIBE
testsCREATE TABLE
works correctly via query method