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

chore: add warning for measurement name starts with hash #495

Merged
merged 3 commits into from
Aug 23, 2022
Merged

Conversation

bednar
Copy link
Contributor

@bednar bednar commented Aug 22, 2022

Closes #473

Proposed Changes

Added warning for measurement name starts with #:

The measurement name '#my_measurement' start with '#'.

The output Line protocol will be interpret as a comment by InfluxDB. For more info see:

Checklist

  • CHANGELOG.md updated
  • Rebased/mergeable
  • A test has been added if appropriate
  • pytest tests completes successfully
  • Commit messages are conventional
  • Sign CLA (if not already signed)

@codecov-commenter
Copy link

Codecov Report

Merging #495 (2b330e1) into master (fade9e0) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #495      +/-   ##
==========================================
+ Coverage   90.52%   90.53%   +0.01%     
==========================================
  Files          39       39              
  Lines        3355     3359       +4     
==========================================
+ Hits         3037     3041       +4     
  Misses        318      318              
Impacted Files Coverage Δ
influxdb_client/client/write/point.py 96.77% <100.00%> (+0.08%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@bednar bednar marked this pull request as ready for review August 22, 2022 12:33
@bednar bednar requested review from rhajek and powersj August 22, 2022 12:33
Copy link
Contributor

@powersj powersj left a comment

Choose a reason for hiding this comment

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

I am generally good with only doing this check to the Point helper class. I do not think this actually helps the original reporter, but I think referencing the docs is good enough as it seems less than ideal to loop through every datapoint beforehand.

@bednar
Copy link
Contributor Author

bednar commented Aug 23, 2022

I think it can also help to the reporter because the write_api uses a Point to write dictionary:

def from_dict(dictionary: dict, write_precision: WritePrecision = DEFAULT_WRITE_PRECISION, **kwargs):

@bednar bednar merged commit 4150bf7 into master Aug 23, 2022
@bednar bednar deleted the hash_warning branch August 23, 2022 11:04
@bednar bednar added this to the 1.32.0 milestone Aug 23, 2022
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.

Warn on measurement starting with hashtags
3 participants