Skip to content
This repository has been archived by the owner on Aug 5, 2023. It is now read-only.

Added precision to 'write' request #30

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

aratz-lasa
Copy link

@aratz-lasa aratz-lasa commented Mar 24, 2020

I have implemented the precision parameter, as InfluxDB API reference contains a precision parameter.

The only thing is that I have not been able to setup the testing environment to check it works correctly. All the tests except test_statement_error pass.

Hope it helps! Your library is very useful, thank you!

Tries to resolve #25

@codecov-io
Copy link

codecov-io commented Mar 25, 2020

Codecov Report

Merging #30 into master will decrease coverage by 0.17%.
The diff coverage is 50.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #30      +/-   ##
==========================================
- Coverage   96.51%   96.34%   -0.18%     
==========================================
  Files           9        9              
  Lines         545      547       +2     
==========================================
+ Hits          526      527       +1     
- Misses         19       20       +1     
Impacted Files Coverage Δ
aioinflux/client.py 93.63% <50.00%> (-0.41%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b318662...859c305. Read the comment docs.

Copy link

@ahesford ahesford left a comment

Choose a reason for hiding this comment

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

I'm keen to see this implemented!

loop: Optional[asyncio.AbstractEventLoop] = None,
redis_opts: Optional[dict] = None,
cache_expiry: int = 86400,
**kwargs

Choose a reason for hiding this comment

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

Restore original indentation

precision: Optional[str] = None,
rp: Optional[str] = None,
tag_columns: Optional[Iterable] = None,
**extra_tags,

Choose a reason for hiding this comment

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

Restore original indentation

raise NotImplementedError("'precision' parameter is not supported yet")
if precision and precision not in {"ns", "u", "ms", "s", "m", "h"}:
raise NotImplementedError("'precision' must must be one of "
"the following: 'ns', 'u', 'ms', 's', 'm', 'h'")

Choose a reason for hiding this comment

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

Should probably raise ValueError instead

chunked: bool = False,
chunk_size: Optional[int] = None,
db: Optional[str] = None,
use_cache: bool = False,

Choose a reason for hiding this comment

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

Restore original indentation

@claashk
Copy link

claashk commented Dec 23, 2020

I would like to use this feature, too. Is there anything I could do help finalizing this PR ?

@ph4z
Copy link

ph4z commented Mar 13, 2021

i'd like to use this too, especially because is mentioned in the official optimization documentation: https://docs.influxdata.com/influxdb/cloud/write-data/best-practices/optimize-writes/#use-the-coarsest-time-precision-possible

@gusutabopb gusutabopb force-pushed the master branch 2 times, most recently from 236e958 to b124183 Compare August 5, 2023 06:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

support for specifying precision when writing metric
5 participants