Skip to content
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

Merged
merged 6 commits into from
Jan 11, 2016
Merged

READY: RTS-667 / RTS-796 #422

merged 6 commits into from
Jan 11, 2016

Conversation

lukebakken
Copy link
Contributor

  • Add DESCRIBE tests
  • Add method to encapsulate retrieving table description
  • Add tests to ensure CREATE TABLE works correctly via query method

…feature to interpolate table name in queries if "{table}" is in query string.
@lukebakken lukebakken changed the title WIP: RTS-667 / RTS-796 Ready: RTS-667 / RTS-796 Jan 4, 2016
req.query.base = str_to_bytes(query)

q = query
if '{table}' in q:
Copy link
Contributor Author

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.

@lukebakken lukebakken changed the title Ready: RTS-667 / RTS-796 WIP: RTS-667 / RTS-796 Jan 5, 2016
@hazen
Copy link

hazen commented Jan 7, 2016

test_query_that_matches_more_data (riak.tests.test_timeseries.TimeseriesTests) ... ERROR
test_query_that_matches_some_data (riak.tests.test_timeseries.TimeseriesTests) ... ERROR
test_query_that_matches_some_data_using_interpolation (riak.tests.test_timeseries.TimeseriesTests) ... ERROR

Looks like these were failing with TS 1.0 and the Python 2.3.0 client, too

@lukebakken
Copy link
Contributor Author

@javajolt - really? I'll give that a try. I know they worked at one point with a 1.0 RC.

@lukebakken lukebakken changed the title WIP: RTS-667 / RTS-796 READY: RTS-667 / RTS-796 Jan 7, 2016
@@ -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):
Copy link

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?

Copy link
Contributor Author

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

@lukebakken
Copy link
Contributor Author

@javajolt TS tests pass this morning with RC7

@hazen
Copy link

hazen commented Jan 11, 2016

👍 6f169a7

borshop added a commit that referenced this pull request Jan 11, 2016
READY: RTS-667 / RTS-796

Reviewed-by: javajolt
@hazen
Copy link

hazen commented Jan 11, 2016

@borshop merge

@borshop borshop merged commit 6f169a7 into master Jan 11, 2016
@lukebakken lukebakken deleted the features/lrb/rts-667-796-ts-1.1 branch January 11, 2016 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants