Skip to content

Commit

Permalink
SkyPortalPublisher: raise a more informative error when compiler_opts…
Browse files Browse the repository at this point in the history
… was not set
  • Loading branch information
jvansanten committed May 30, 2024
1 parent 69bfc7a commit 300e256
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ampel/ztf/t3/skyportal/SkyPortalClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,7 @@ async def post_candidate(
)
}
group_ids = {await self.get_by_name("groups", name) for name in (groups or [])}
assert "tag" in view.stock, f"{self.__class__} requires stocks with a `tag` field. Did you remember to set AlertConsumer.compiler_opts?"
assert view.stock["tag"] is not None
instrument_id = (
await self.get_by_name("instrument", instrument)
Expand All @@ -658,6 +659,7 @@ async def post_candidate(
)

assert view.stock
assert "name" in view.stock, f"{self.__class__} requires stocks with a `name` field. Did you remember to set AlertConsumer.compiler_opts?"
assert view.stock["name"] is not None
name = next(
n for n in view.stock["name"] if isinstance(n, str) and n.startswith("ZTF")
Expand Down

0 comments on commit 300e256

Please sign in to comment.