diff --git a/src/finam/schedule.py b/src/finam/schedule.py index f058df8f03bcddd3148d342edc83a8b026c33e9d..58301659fb1104b261227447c90611c4751beca3 100644 --- a/src/finam/schedule.py +++ b/src/finam/schedule.py @@ -11,9 +11,9 @@ Composition """ import logging import sys -from time import strftime from datetime import datetime from pathlib import Path +from time import strftime from .errors import ( FinamCircularCouplingError, diff --git a/src/finam/sdk/component.py b/src/finam/sdk/component.py index 000b2554c0811b477dd6594900079223b74180cd..406a870737f54dff071644cafd479a091957e7ed 100644 --- a/src/finam/sdk/component.py +++ b/src/finam/sdk/component.py @@ -1,8 +1,8 @@ """ Abstract base implementations for components with and without time step. """ -import datetime import collections +import datetime import logging from abc import ABC from datetime import datetime @@ -440,7 +440,8 @@ class TimeComponent(ITimeComponent, Component, ABC): if self._time is None and self.status in ( ComponentStatus.CREATED or ComponentStatus.INITIALIZED ): - """A time of None is ok before the connect phase""" + return None + if not isinstance(self._time, datetime): with ErrorLogger(self.logger): raise ValueError("Time must be of type datetime")