Commit 6f73ea1
authored
fix: Calling commit and _json_body make raising an exception when any 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.py1 parent 6290994 commit 6f73ea1
3 files changed
+12
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
| 177 | + | |
| 178 | + | |
177 | 179 | | |
178 | 180 | | |
179 | 181 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
| 142 | + | |
| 143 | + | |
142 | 144 | | |
143 | 145 | | |
144 | 146 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
50 | 58 | | |
51 | 59 | | |
52 | 60 | | |
| |||
0 commit comments