diff --git a/python/whylogs/api/whylabs/session/config.py b/python/whylogs/api/whylabs/session/config.py index 65ec9c83bf..e983690bbd 100644 --- a/python/whylogs/api/whylabs/session/config.py +++ b/python/whylogs/api/whylabs/session/config.py @@ -248,7 +248,7 @@ def _require(self, name: str, value: Optional[str]) -> str: if value is None: session_type = self.get_session_type() raise ValueError( - f"Can't determine {name}. Current session type if {session_type.value}. " + f"Can't determine {name}. Current session type is {session_type.value}. " f"See {_INIT_DOCS} for instructions on using why.init()." ) diff --git a/python/whylogs/api/writer/whylabs.py b/python/whylogs/api/writer/whylabs.py index 50882ed03c..c76fc44255 100644 --- a/python/whylogs/api/writer/whylabs.py +++ b/python/whylogs/api/writer/whylabs.py @@ -60,7 +60,6 @@ FIVE_MINUTES_IN_SECONDS = 60 * 5 DAY_IN_SECONDS = 60 * 60 * 24 -WEEK_IN_SECONDS = DAY_IN_SECONDS * 7 FIVE_YEARS_IN_SECONDS = DAY_IN_SECONDS * 365 * 5 logger = logging.getLogger(__name__) @@ -596,19 +595,12 @@ def write(self, file: Writable, **kwargs: Any) -> Tuple[bool, str]: f"About to upload a profile with a dataset_timestamp that is in the future: " f"{time_delta_seconds}s old." ) - elif time_delta_seconds > WEEK_IN_SECONDS: - if time_delta_seconds > FIVE_YEARS_IN_SECONDS: - logger.error( - f"A profile being uploaded to WhyLabs has a dataset_timestamp of({dataset_timestamp}) " - f"compared to current datetime: {utc_now}. Uploads of profiles older than 5 years " - "might not be monitored in WhyLabs and may take up to 24 hours to show up." - ) - else: - logger.warning( - f"A profile being uploaded to WhyLabs has a dataset_timestamp of {dataset_timestamp} " - f"which is older than 7 days compared to {utc_now}. These profiles should be processed " - f"within 24 hours." - ) + if time_delta_seconds > FIVE_YEARS_IN_SECONDS: + logger.error( + f"A profile being uploaded to WhyLabs has a dataset_timestamp of({dataset_timestamp}) " + f"compared to current datetime: {utc_now}. Uploads of profiles older than 5 years " + "might not be monitored in WhyLabs and may take up to 24 hours to show up." + ) if stamp <= 0: logger.error( diff --git a/python/whylogs/api/writer/writer.py b/python/whylogs/api/writer/writer.py index e9bd6bc74c..616b7f1d4a 100644 --- a/python/whylogs/api/writer/writer.py +++ b/python/whylogs/api/writer/writer.py @@ -29,8 +29,9 @@ class Writer(ABC): def check_interval(self, interval_seconds: int) -> None: """Validate an interval configuration for a given writer. - Some writer only accepts certain interval configuration. By default, this should return True for a valid - non-negative interval.""" + Some writer only accepts certain interval configuration. Raise BadConfigError for + an unacceptable interval.""" + pass @abstractmethod def write(