-
Notifications
You must be signed in to change notification settings - Fork 524
Add get_list_measurements and drop_measurement #402
Conversation
What does the tarvis-ci report mean? Does doc building need length check ? pls, give me a prompt to fix this error |
The docs tests seems unrelated. I have restarted the job. Could you add tests for this PR please? |
@aviau Test case done. :) but the doc building failed, again. :( |
According to sphinx-doc/sphinx#3212 sphinx 1.5.1 fix this (AssertionError: len(context) = 1) doc building problem |
influxdb/client.py
Outdated
def drop_measurement(self, measurementname): | ||
"""Drop a measurement from InfluxDB. | ||
|
||
:param dbname: the name of the measurement to drop |
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.
Should be measurementname
instead of dbname
according to the method's signature. But even better would be to rename the parameter to measurement
in order to be consistent with naming in other methods.
{u'name': u'measurements2'}, | ||
{u'name': u'measurements3'}] | ||
""" | ||
return list(self.query("SHOW MEASUREMENTS").get_points()) |
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.
Would be good to add support for on
clause which was added in InfluxDB 1.1.
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.
By checking InfluxDB 1.2 docs about show measurements.
There was more than one clause needed to support. on , with measurement, where, limit, offset.
Support all the clauses maybe coming from another PR, and it's better that we could discuss the interface of this feature.
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.
I concur with @Vic020, there are features added regularly that we'll need to keep up with. Since we're officially supporting the v1.2.4 release this is fine as-is.
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.
Thanks for the contribution! Small nits, but overall this is useful.
{u'name': u'measurements2'}, | ||
{u'name': u'measurements3'}] | ||
""" | ||
return list(self.query("SHOW MEASUREMENTS").get_points()) |
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.
I concur with @Vic020, there are features added regularly that we'll need to keep up with. Since we're officially supporting the v1.2.4 release this is fine as-is.
tox.ini
Outdated
@@ -26,7 +26,7 @@ commands = nosetests -v --with-coverage --cover-html --cover-package=influxdb | |||
[testenv:docs] | |||
deps = -r{toxinidir}/requirements.txt | |||
pandas | |||
Sphinx==1.2.3 | |||
Sphinx==1.5.1 |
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.
Can you please remove this, we're already up to v1.5.5?
Dear maintainer, Look likes we are missing the get list measurements and drop measurement feature for client. pls accept this pr.
@sebito91 Thanks. You are right, already deleted Sphinx version modification, and added docstring for tests. Hope to receive your feedback. :) |
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.
Great, looks good and tests are working. Thanks a lot for your help!
Test drop measurement for TestInfluxDBClient object. ... ok
Dear maintainer,
Look likes we are missing the get list measurements and drop measurement feature for client.
pls accept this pr.