feat: add RSS data models (SQLAlchemy + Pydantic)#857
Conversation
dee80c6 to
bf5abcb
Compare
59514d8 to
036cb9c
Compare
cb53ac5 to
87c7b68
Compare
87c7b68 to
5c3f59d
Compare
|
|
||
| metadata = RSSBase.metadata | ||
|
|
||
| async def get_site_status(self, name: str, vo: str = "all") -> tuple[str, str]: |
There was a problem hiding this comment.
@fstagni out of curiosity, shouldn't we (not now but later) transition from this magic all to NULL in the DB?
If not VO is set, then we assume it's for all of them.
Unless I miss something?
| async def get_resource_status( | ||
| self, | ||
| name: str, | ||
| statustypes: list[str] = ["all"], |
There was a problem hiding this comment.
Beware of https://docs.astral.sh/ruff/rules/mutable-argument-default/
It's fine here because we don't mutate status_types but we should be careful.
@fstagni same here, should we transition from all for VO and StatusType to NULL at some point?
There was a problem hiding this comment.
I would agree to this one too.
|
|
||
| metadata = RSSBase.metadata | ||
|
|
||
| async def get_site_status(self, name: str, vo: str = "all") -> tuple[str, str]: |
| async def get_resource_status( | ||
| self, | ||
| name: str, | ||
| statustypes: list[str] = ["all"], |
There was a problem hiding this comment.
I would agree to this one too.
| ) | ||
|
|
||
|
|
||
| class ResourceNotFoundError(DiracError): |
There was a problem hiding this comment.
I am really wondering if we need this one at all.
There was a problem hiding this comment.
I used to use a raise ValueError to handle missing sites and resources, but Alexandre advised me to use a ResourceNotFoundError in diracx/core/exceptions.py instead.
Do you think we should handle it differently ?
5c3f59d to
e049282
Compare
Closes #837
Changes :