Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions scripts/xml2es.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ def convert_str2datetime(date_str: str) -> str:
return date_str # fallback to original if parsing fails

@staticmethod
def convert_str2float(value_str: str) -> float | str:
def convert_str2float(value_str: str) -> float:
"""Convert value string to numeric type (float)."""
try:
return float(value_str)
except (ValueError, TypeError):
return value_str # fallback to original if parsing fails
return 0.0 # fallback to 0 if parsing fails

def parse_xml(self) -> Generator[dict[str, Any], None, None]:
"""
Expand Down