Skip to content
This repository was archived by the owner on Oct 29, 2024. It is now read-only.

Add get_list_measurements and drop_measurement #402

Merged
merged 4 commits into from
Sep 8, 2017
Merged

Add get_list_measurements and drop_measurement #402

merged 4 commits into from
Sep 8, 2017

Conversation

Vic020
Copy link
Contributor

@Vic020 Vic020 commented Dec 26, 2016

Dear maintainer,

Look likes we are missing the get list measurements and drop measurement feature for client.

pls accept this pr.

@Vic020
Copy link
Contributor Author

Vic020 commented Dec 26, 2016

What does the tarvis-ci report mean?

Does doc building need length check ?

pls, give me a prompt to fix this error

@aviau
Copy link
Collaborator

aviau commented Dec 26, 2016

The docs tests seems unrelated. I have restarted the job.

Could you add tests for this PR please?

@Vic020
Copy link
Contributor Author

Vic020 commented Dec 26, 2016

@aviau Test case done. :)

but the doc building failed, again. :(

@Vic020
Copy link
Contributor Author

Vic020 commented Dec 27, 2016

@aviau

According to sphinx-doc/sphinx#3212

sphinx 1.5.1 fix this (AssertionError: len(context) = 1) doc building problem

def drop_measurement(self, measurementname):
"""Drop a measurement from InfluxDB.

:param dbname: the name of the measurement to drop
Copy link
Contributor

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())
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@smolse

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.

Copy link
Contributor

@sebito91 sebito91 Sep 7, 2017

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.

Copy link
Contributor

@sebito91 sebito91 left a 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())
Copy link
Contributor

@sebito91 sebito91 Sep 7, 2017

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
Copy link
Contributor

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?

Vic020 and others added 4 commits September 8, 2017 09:24
Dear maintainer,

Look likes we are missing the get list measurements and drop measurement feature for client.

pls accept this pr.
@Vic020
Copy link
Contributor Author

Vic020 commented Sep 8, 2017

@sebito91 Thanks.

You are right, already deleted Sphinx version modification, and added docstring for tests.

Hope to receive your feedback.

:)

Copy link
Contributor

@sebito91 sebito91 left a 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

@sebito91 sebito91 merged commit df6e2fe into influxdata:master Sep 8, 2017
@Vic020 Vic020 deleted the patch-1 branch December 6, 2017 03:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants