-
Notifications
You must be signed in to change notification settings - Fork 45
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Description
The current implementation of _extract_timestamp() in src/powerapi/report/report.py, fails to parse valid ISO 8601 timestamps that include timezone information (e.g., '2025-04-03T12:36:20.800232411+00:00').
The function only handles ISO 8601 timestamps without timezone information.
Expected Behavior
The function should successfully parse ISO 8601 timestamps with timezone information.
Current Behavior
The function raises a ValueError when parsing timestamps with timezone information.
Example code
from datetime import datetime
from powerapi.report.report import Report
timestamp = '2025-04-03T12:36:20.800232411+00:00'
try:
ts = Report._extract_timestamp(timestamp)
print(f"Timestamp: {ts}")
except ValueError as e:
print(f"Error: {e}")Versions
powerapi : 2.10.0
python : 3.13.2
Optional notes
datetime.fromisoformat()was added in Python 3.7
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request