-
Notifications
You must be signed in to change notification settings - Fork 185
READY: RTS-667 / RTS-796 #422
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
Changes from all commits
9eedc47
fa12c25
a392963
44721f8
f33059d
6f169a7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -173,6 +173,10 @@ def put(self, robj, w=None, dw=None, pw=None, return_body=True, | |
|
|
||
| return robj | ||
|
|
||
| def ts_describe(self, table): | ||
| query = 'DESCRIBE {table}'.format(table=table.name) | ||
| return self.ts_query(table, query) | ||
|
|
||
| def ts_get(self, table, key): | ||
| req = riak.pb.riak_ts_pb2.TsGetReq() | ||
| self._encode_timeseries_keyreq(table, key, req) | ||
|
|
@@ -213,7 +217,12 @@ def ts_delete(self, table, key): | |
|
|
||
| def ts_query(self, table, query, interpolations=None): | ||
| req = riak.pb.riak_ts_pb2.TsQueryReq() | ||
| req.query.base = str_to_bytes(query) | ||
|
|
||
| q = query | ||
| if '{table}' in q: | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
| q = q.format(table=table.name) | ||
|
|
||
| req.query.base = str_to_bytes(q) | ||
|
|
||
| msg_code, ts_query_resp = self._request( | ||
| riak.pb.messages.MSG_CODE_TS_QUERY_REQ, req, | ||
|
|
||
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 usefmtto replace it before passing tots_query. Within the code for queries, it will check for{table}and, if present, insert the table name.Note that
ts_querytakes atableparameter than can be aTableobject 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