# ask-ai

Daniel Koops

02/20/2024, 4:01 PM
@Scout I'm getting the following error when trying to start a schedule. There is no datetime object in the schedule definition.
dagster._serdes.errors.SerializationError: Unhandled value type <class 'datetime.datetime'>


02/20/2024, 4:01 PM
Based on the documentation, Dagster schedules are designed to work with datetime objects, particularly when defining the scheduled execution time. However, the error you're encountering,
dagster._serdes.errors.SerializationError: Unhandled value type <class 'datetime.datetime'>
, suggests that there is an issue with serializing a datetime object. This error could occur if there is an attempt to serialize a Python object that is not natively serializable to JSON, which is the format used by Dagster for inter-process communication. Dagster has a set of supported types for config values, and while datetime objects are commonly used within the scheduling context, they may need to be handled appropriately when passing through the serialization boundaries. To address this issue, you should ensure that any datetime objects are converted to a string or a timestamp before being passed to a part of the system that requires serialization. For example, if you are trying to pass a datetime object as part of the run configuration, you might need to format it as an ISO 8601 string. If you are defining a schedule and using the
parameter within the
, it should be handled correctly by Dagster's internal mechanisms. If you're encountering this error, it could be due to custom code that is not correctly serializing datetime objects. Without more context or a code snippet, it's difficult to provide a precise solution. If you're able to share more details about where the datetime object is being used in your schedule definition, I could provide more targeted advice. Otherwise, you may want to review your code to ensure that datetime objects are being serialized to strings before being passed to Dagster's APIs that require serialization.