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

DM-42677: Don't forward visits with instrument="" #9

Merged
merged 2 commits into from
Jan 26, 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
7 changes: 5 additions & 2 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ class NextVisitModel:
groupId: str
coordinateSystem: int
position: typing.List[int]
startTime: float
rotationSystem: int
cameraAngle: float
filters: str
Expand Down Expand Up @@ -254,6 +253,11 @@ async def main() -> None:

logging.info(f"message deserialized {next_visit_message_initial}")

if not next_visit_message_initial["message"]["instrument"]:
logging.info("Message does not have an instrument. Assuming "
"it's not an observation.")
continue

next_visit_message_updated = NextVisitModel(
salIndex=next_visit_message_initial["message"]["salIndex"],
scriptSalIndex=next_visit_message_initial["message"][
Expand All @@ -265,7 +269,6 @@ async def main() -> None:
"coordinateSystem"
],
position=next_visit_message_initial["message"]["position"],
startTime=next_visit_message_initial["message"]["startTime"],
rotationSystem=next_visit_message_initial["message"][
"rotationSystem"
],
Expand Down
Loading