This repository was archived by the owner on Oct 29, 2024. It is now read-only.
fix: Calling commit and _json_body make raising an exception when any datapoints are not added. #772
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If any SerialHelper is not generated, calling the commit function makes raising an exception because _datapoints is not allocated.
It is hard to find the reason of this error. it is because reviewing influxdb-python's code is needed.
I think that it is important that is producing predictable results. Results when calling first time is needed to equal to calling resetting datapoints in json_body.
So, I've fixed that if not initialized when calling _json_body() function, _datapoints is reset to avoid raising error.
In Unittest, the setup function is added. When calling setup function firstly, initialized is False and _datapoints is not assigned. But, because of this commit, it is OK.
Contacts: Keunhyun Oh keunhyun.oh@ahnlab.com
Contributor checklist