Skip to content

BUG: Handle invalid filters consistently#287

Merged
nourinmohd merged 2 commits into
equinor:mainfrom
nourinmohd:282_handle_invalid_filters
Jun 29, 2026
Merged

BUG: Handle invalid filters consistently#287
nourinmohd merged 2 commits into
equinor:mainfrom
nourinmohd:282_handle_invalid_filters

Conversation

@nourinmohd

@nourinmohd nourinmohd commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Resolves #282

  • Added validation in LogManager.filter_log() so unknown fields and incompatible FilterType/field combinations raise ValueError before Pandas filtering.
  • Short-circuited empty logs to return an empty log of the same model type.
  • Added regression tests for empty logs, unknown fields, and invalid text/date/number filter combinations.

Checklist

  • Tests added (if not, comment why)
  • Test coverage equal or up from main (run pytest with --cov=src/ --cov-report term-missing)
  • If not squash merging, every commit passes tests
  • Appropriate commit prefix and precise commit message used
  • All debug prints and unnecessary comments removed
  • Docstrings are correct and updated
  • Documentation is updated, if necessary
  • Latest main rebased/merged into branch
  • Added comments on this PR where appropriate to help reviewers
  • Moved issue status on project board
  • Checked the boxes in this checklist ✅

Comment thread src/fmu/settings/_resources/log_manager.py
Comment thread src/fmu/settings/_resources/log_manager.py Outdated

@GibranAlfa GibranAlfa left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nice work 👍

@nourinmohd
nourinmohd merged commit cddd00b into equinor:main Jun 29, 2026
9 checks passed
@nourinmohd
nourinmohd deleted the 282_handle_invalid_filters branch June 29, 2026 07:56
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.

Make LogManager.filter_log() handle invalid filters consistently

2 participants