@@ -160,9 +160,9 @@ def __init__(self, data_frame, point_settings, precision=DEFAULT_WRITE_PRECISION
160
160
# This column is a tag column.
161
161
if null_columns [index ]:
162
162
key_value = f"""{{
163
- '{ _EMPTY_EXPRESSION } ' if { val_format } == '' or type({ val_format } ) == float and math.isnan({ val_format } ) else
163
+ '' if { val_format } == '' or type({ val_format } ) == float and math.isnan({ val_format } ) else
164
164
f',{ key_format } ={{str({ val_format } ).translate(_ESCAPE_STRING)}}'
165
- }}""" # noqa: E501
165
+ }}"""
166
166
else :
167
167
key_value = f',{ key_format } ={{str({ val_format } ).translate(_ESCAPE_KEY)}}'
168
168
tags .append (key_value )
@@ -181,14 +181,14 @@ def __init__(self, data_frame, point_settings, precision=DEFAULT_WRITE_PRECISION
181
181
elif issubclass (value .type , np .floating ):
182
182
if null_columns [index ]:
183
183
field_value = f"""{{
184
- "{ _EMPTY_EXPRESSION } " if math.isnan({ val_format } ) else f"{ sep } { key_format } ={{{ val_format } }}"
184
+ "{ sep } { _EMPTY_EXPRESSION } " if math.isnan({ val_format } ) else f"{ sep } { key_format } ={{{ val_format } }}"
185
185
}}"""
186
186
else :
187
187
field_value = f'{ sep } { key_format } ={{{ val_format } }}'
188
188
else :
189
189
if null_columns [index ]:
190
190
field_value = f"""{{
191
- '{ _EMPTY_EXPRESSION } ' if type({ val_format } ) == float and math.isnan({ val_format } ) else
191
+ '{ sep } { _EMPTY_EXPRESSION } ' if type({ val_format } ) == float and math.isnan({ val_format } ) else
192
192
f'{ sep } { key_format } ="{{str({ val_format } ).translate(_ESCAPE_STRING)}}"'
193
193
}}"""
194
194
else :
@@ -249,7 +249,7 @@ def serialize(self, chunk_idx: int = None):
249
249
if self .first_field_maybe_null :
250
250
# When the first field is null (None/NaN), we'll have
251
251
# a spurious leading comma which needs to be removed.
252
- lp = (re .sub (f"{ _EMPTY_EXPRESSION } ,|{ _EMPTY_EXPRESSION } " , '' , self .f (p ))
252
+ lp = (re .sub (f", { _EMPTY_EXPRESSION } | { _EMPTY_EXPRESSION } ,|{ _EMPTY_EXPRESSION } " , '' , self .f (p ))
253
253
for p in filter (lambda x : _any_not_nan (x , self .field_indexes ), _itertuples (chunk )))
254
254
return list (lp )
255
255
else :
0 commit comments