Skip to content

Commit

Permalink
remove 7-day old profile warning (#1377)
Browse files Browse the repository at this point in the history
## Description

Removes whylabs writer warning for 7-day old profiles.

Closes whylabs/whylogs/#1375

- [ ] I have reviewed the [Guidelines for Contributing](CONTRIBUTING.md)
and the [Code of Conduct](CODE_OF_CONDUCT.md).

---------

Co-authored-by: Jamie Broomall <[email protected]>
  • Loading branch information
richard-rogers and jamie256 authored Sep 19, 2023
1 parent a927f7d commit 338d3d4
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions python/whylogs/api/writer/whylabs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__)

Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 338d3d4

Please sign in to comment.