-
Notifications
You must be signed in to change notification settings - Fork 0
Added sorting functionality #767
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll need to show me how to actually use this so that I can test it :)
@@ -125,6 +126,20 @@ def abort(self) -> bool: | |||
"""Retrieve if alert can abort simulations""" | |||
return self._get_attribute("abort") | |||
|
|||
@property | |||
@staging_check | |||
def delay(self) -> int: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait what is this? You can delay the start of an alert?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If that's the case then we should also add this functionality into the Run class in another MR :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure, this is just a value available in the RestAPI response, @alahiff ?
@@ -65,6 +78,8 @@ def get( | |||
limit the number of results, default of None returns all. | |||
offset : int, optional | |||
start index for returned results, default of None starts at 0. | |||
sorting : list[dict] | None, optional |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really clear what this would be, what does each item in the list correspond to? Wouldnt you just want one sorting parameter for all the things youre getting?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the low level API so just mirrors the RestAPI which expects a list in the form [{"id": <column>, "desc": <if-descending-else-ascending>}]
@pydantic.field_validator("column") | ||
@classmethod | ||
def check_column(cls, column: str) -> str: | ||
if column and column not in ("name", "created"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be really useful to have a column which sorts by time set to critical, no idea if thats possible
Sorting of Runs, Artifacts, Tags, Folders, Alerts
Issue: #766
Python Version(s) Tested: 3.13
Operating System(s): Ubuntu 24.10
Documentation PR: N/A
📝 Summary
Adds compatibility with the server side sorting when using
GET
to retrieve objects.🔄 Changes
Added additional argument
sorting
to relevant low level API classes where the user then provides the sorting list:Also adds same functionality to user API:
✔️ Checklist