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

Add support for content filtering #303

Merged
merged 1 commit into from
Mar 7, 2024
Merged

Add support for content filtering #303

merged 1 commit into from
Mar 7, 2024

Conversation

adnejacobsen
Copy link
Contributor

@adnejacobsen adnejacobsen commented Mar 6, 2024

Issue

Link to the issue resolved by this PR.

Short description

Add content parameter to filter methods and add a contents property for retrieving unique content values in a collection.

Pre-review checklist

  • Read through all changes. No redundant print() statements, commented-out code, or other remnants from the development. 👀
  • Make sure tests pass after every commit. ✅
  • New/refactored code is following same conventions as the rest of the code base. 🧬
  • New/refactored code is tested. ⚙
  • Documentation has been updated 🧾

Pre-merge checklist

  • Commit history is consistent and clean. 👌

@adnejacobsen adnejacobsen requested a review from a team March 6, 2024 14:09
Copy link
Contributor

@equinor-ruaj equinor-ruaj left a comment

Choose a reason for hiding this comment

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

👍

Comment on lines +112 to +117
def contents(self) -> List[str]:
"""List of unique contents"""
return self._get_field_values("data.content.keyword")

@property
async def contents_async(self) -> List[str]:
Copy link
Contributor

Choose a reason for hiding this comment

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

Can it be confusing that these say contentS, while the metadata is content?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could be.. looks like we've gone with plurals for most of the other properties (names, tagnames, iterations, realizations, stages). Maybe we should switch strategy completely and add a method for getting unique values, so it would be something like surfaces.unique("data.content")

@adnejacobsen adnejacobsen merged commit 1a5e2c1 into main Mar 7, 2024
21 checks passed
@adnejacobsen adnejacobsen deleted the content-filtering branch March 8, 2024 07:24
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.

2 participants