Piotr
07/11/2025, 10:00 AMMarvin
07/11/2025, 10:00 AMMarvin
07/11/2025, 10:01 AMscheduled_start_time
is actually an attribute, not a method, so you would access it as flow_run.scheduled_start_time
rather than calling flow_run.get_scheduled_start_time()
.
The scheduled_start_time
is typically returned as an ISO-formatted string. To convert it to a Python datetime object, you can use one of these approaches:
python
from datetime import datetime
from dateutil import parser
# Option 1: Using datetime.fromisoformat()
datetime_obj = datetime.fromisoformat(flow_run.scheduled_start_time)
# Option 2: Using dateutil parser (more flexible)
datetime_obj = parser.parse(flow_run.scheduled_start_time)
The dateutil.parser
approach is more flexible and can handle various datetime string formats, while datetime.fromisoformat()
is built into Python's standard library but expects specifically formatted ISO strings.
If you're seeing a different return type or getting any errors with these conversions, please let me know what type you're actually getting (you can check with print(type(flow_run.scheduled_start_time))
) and I can provide more specific guidance.