Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WNTR topic date convention #286

Merged
merged 1 commit into from
Mar 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions kowalski/alert_brokers/alert_broker_winter.py
Original file line number Diff line number Diff line change
Expand Up @@ -584,15 +584,19 @@ def watchdog(obs_date: str = None, test: bool = False):
try:

if obs_date is None:
datestr = datetime.datetime.utcnow().strftime("%Y%m%d")
# for WNTR, the date that the data is sent to is the date of observation in local time
# not UTC, which is essentially UTC - 1 day
datestr = (
datetime.datetime.utcnow() - datetime.timedelta(days=1)
).strftime("%Y%m%d")
else:
datestr = obs_date

# get kafka topic names with kafka-topics command
if not test:
# Production Kafka stream at IPAC

# as of 20220801, the naming convention is winter_%Y%m%
# as of 20220801, the naming convention is winter_%Y%m%d
topics_tonight = [f"winter_{datestr}"]
else:
# Local test stream
Expand Down
Loading