Skip to content
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

Merged

Conversation

ocworld
Copy link
Contributor

@ocworld ocworld commented Dec 5, 2019

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
  • Builds are passing
  • New tests have been added (for feature additions)

…es 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>
@ocworld ocworld changed the title fix: Calling commit and _json_body makes raising an exception when any datapoints are not added. fix: Calling commit and _json_body make raising an exception when any datapoints are not added. Dec 5, 2019
Keunhyun Oh added 6 commits December 6, 2019 00:41
Contacts: Keunhyun Oh <keunhyun.oh@ahnlab.com>
Contacts: Keunhyun Oh <keunhyun.oh@ahnlab.com>
Contacts: Keunhyun Oh <keunhyun.oh@ahnlab.com>
@ocworld
Copy link
Contributor Author

ocworld commented Jan 10, 2020

@AhnLab-OSS

@sebito91 sebito91 self-assigned this Apr 8, 2020
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.

Seems good to me, thanks for the contribution @ocworld!

@sebito91 sebito91 merged commit 6f73ea1 into influxdata:master Apr 10, 2020
ocworld added a commit to AhnLab-OSS/influxdb-python that referenced this pull request Apr 13, 2020
… datapoints are not added. (influxdata#772)

* 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>

* fix build fail

Contacts: Keunhyun Oh <keunhyun.oh@ahnlab.com>

* fix build fail

Contacts: Keunhyun Oh <keunhyun.oh@ahnlab.com>

* fix build fail

Contacts: Keunhyun Oh <keunhyun.oh@ahnlab.com>

* Update helper_test.py

* Update helper_test.py

* Update helper_test.py
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.

2 participants