Skip to content

Commit

Permalink
fix: numpy no longer supports np.float type (#543)
Browse files Browse the repository at this point in the history
  • Loading branch information
bednar authored Dec 27, 2022
1 parent 03f5bd7 commit df12e0b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/test_WriteApiDataFrame.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ def test_write_num_py_floats(self):
from influxdb_client.extras import pd, np
now = pd.Timestamp('2020-04-05 00:00+00:00')

float_types = [np.float, np.float16, np.float32, np.float64]
float_types = [np.float16, np.float32, np.float64]
if hasattr(np, 'float128'):
float_types.append(np.float128)
for np_float_type in float_types:
Expand Down
3 changes: 1 addition & 2 deletions tests/test_point.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,6 @@ def test_numpy_types(self):

point = Point.measurement("h2o") \
.tag("location", "europe") \
.field("np.float1", np.float(1.123)) \
.field("np.float2", np.float16(2.123)) \
.field("np.float3", np.float32(3.123)) \
.field("np.float4", np.float64(4.123)) \
Expand All @@ -413,7 +412,7 @@ def test_numpy_types(self):
.field("np.uint4", np.uint64(8))

self.assertEqual(
"h2o,location=europe np.float1=1.123,np.float2=2.123,np.float3=3.123,np.float4=4.123,np.int1=1i,np.int2=2i,np.int3=3i,np.int4=4i,np.uint1=5i,np.uint2=6i,np.uint3=7i,np.uint4=8i",
"h2o,location=europe np.float2=2.123,np.float3=3.123,np.float4=4.123,np.int1=1i,np.int2=2i,np.int3=3i,np.int4=4i,np.uint1=5i,np.uint2=6i,np.uint3=7i,np.uint4=8i",
point.to_line_protocol())

def test_from_dictionary_custom_measurement(self):
Expand Down

0 comments on commit df12e0b

Please sign in to comment.