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

Added filtering option for entities listing #513

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

VukW
Copy link
Contributor

@VukW VukW commented Nov 27, 2023

Solution for #496 : add --valid flag for entity listing:

medperf mlcube ls --valid
medperf dataset ls --valid
medperf benchmark ls --valid
medperf result ls --valid

Waits for #509 to implement is_valid flag for Result entity

@VukW VukW requested a review from a team as a code owner November 27, 2023 17:28
@VukW VukW had a problem deploying to testing-external-code November 27, 2023 17:28 — with GitHub Actions Failure
Copy link
Contributor

github-actions bot commented Nov 27, 2023

MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅

@@ -5,15 +5,14 @@
class Entity(ABC):
@abstractmethod
def all(
cls, local_only: bool = False, comms_func: callable = None
cls, local_only: bool = False, filters: dict = None
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fix was not connected to ls valid feature, just a bugfix: making abstract function signature relevant to a real implementations

@@ -105,3 +106,6 @@ def default_status(cls, v):
if v is not None:
status = Status(v)
return status

class DeployableEntity(DeployableSchema, Entity):
pass
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This "implementation" is necessary at two places:

  1. Entity list command - to declare that applicable objects should be both DeployableSchema and Entity.
  2. for Entity list test purposes
    However, placing implementation here breaks code design a bit: it make schemas.py dependable from interface.py. Maybe it's worth to move this class definition to other place?


# generate_cube(id=103, is_valid=True, owner=12345),
# generate_cube(id=104, is_valid=False, owner=12345),
]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current behavior is not to filter local cubes by owner. I didn't change it, instead I anchored it in this test case. In future, once we elaborate & implement new ls behavior, these tests have to be changed

@VukW VukW had a problem deploying to testing-external-code November 28, 2023 12:10 — with GitHub Actions Failure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant