Add support for IS NULL and IS NOT NULL comparators in experiment tags#21148
Add support for IS NULL and IS NOT NULL comparators in experiment tags#21148TomeHirata merged 8 commits intomlflow:masterfrom
Conversation
… searches Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
🛠 DevTools 🛠
Install mlflow from this PRFor Databricks, use the following command: |
There was a problem hiding this comment.
Pull request overview
This pull request adds support for IS NULL and IS NOT NULL operators for filtering experiment tags in MLflow's search functionality. The feature allows users to query for experiments that either have or don't have specific tags, regardless of their values.
Changes:
- Extended the search token parser to recognize
IS NULLandIS NOT NULLas valid comparison operators for tags - Added validation to restrict these operators to tags only (not attributes)
- Implemented filtering logic for both SQL-backed stores (using EXISTS subqueries) and file-backed stores (using dictionary membership checks)
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| mlflow/utils/search_utils.py | Extended token parsing to handle IS NULL/IS NOT NULL operators, added validation to restrict usage to tags only, implemented filtering logic for file-based stores |
| mlflow/store/tracking/sqlalchemy_store.py | Implemented SQL EXISTS subquery-based filtering for IS NULL/IS NOT NULL operators on experiment tags |
| tests/store/tracking/test_sqlalchemy_store.py | Added comprehensive test coverage including standalone, combined, and error cases for IS NULL/IS NOT NULL operators |
| tests/store/tracking/test_file_store.py | Added test coverage for IS NULL/IS NOT NULL operators (missing one combined test case present in SQL store tests) |
|
Documentation preview for f6c3d7a is available at: Changed Pages (1)
More info
|
…tion Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
mlflow/utils/search_utils.py
Outdated
|
|
||
|
|
||
| def _join_in_comparison_tokens(tokens, search_traces=False): | ||
| def _join_in_comparison_tokens(tokens, search_traces=False, search_null_operators=False): |
There was a problem hiding this comment.
The new parameter search_null_operators is a bit ambiguous — it could be read as "search for null operators." Something
like support_null_cmp_operator would be clearer.
There was a problem hiding this comment.
Actually I removed search_null_operators at all since this guard is not needed
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
| stripped_comparison = [token for token in comparison.tokens if not token.is_whitespace] | ||
|
|
||
| # Handle IS NULL / IS NOT NULL (2 tokens: identifier + comparator, no value) | ||
| if len(stripped_comparison) == 2: |
There was a problem hiding this comment.
Should we override _validate_comparison instead?
- Add missing 'combined with value filter' test case to file store (matching sqlalchemy store test coverage) - Refactor IS NULL/IS NOT NULL handling to override _validate_comparison instead of pre-checking len in _get_comparison 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
mlflow#21148) Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com> Co-authored-by: Claude <noreply@anthropic.com>
mlflow#21148) Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com> Co-authored-by: Claude <noreply@anthropic.com>
#21148) Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com> Co-authored-by: Claude <noreply@anthropic.com>
Related Issues/PRs
n/a
What changes are proposed in this pull request?
As titled
How is this PR tested?
Does this PR require documentation update?
Does this PR require updating the MLflow Skills repository?
Release Notes
Is this a user-facing change?
What component(s), interfaces, languages, and integrations does this PR affect?
Components
area/tracking: Tracking Service, tracking client APIs, autologgingarea/models: MLmodel format, model serialization/deserialization, flavorsarea/model-registry: Model Registry service, APIs, and the fluent client calls for Model Registryarea/scoring: MLflow Model server, model deployment tools, Spark UDFsarea/evaluation: MLflow model evaluation features, evaluation metrics, and evaluation workflowsarea/gateway: MLflow AI Gateway client APIs, server, and third-party integrationsarea/prompts: MLflow prompt engineering features, prompt templates, and prompt managementarea/tracing: MLflow Tracing features, tracing APIs, and LLM tracing functionalityarea/projects: MLproject format, project running backendsarea/uiux: Front-end, user experience, plotting, JavaScript, JavaScript dev serverarea/build: Build and test infrastructure for MLflowarea/docs: MLflow documentation pagesHow should the PR be classified in the release notes? Choose one:
rn/none- No description will be included. The PR will be mentioned only by the PR number in the "Small Bugfixes and Documentation Updates" sectionrn/breaking-change- The PR will be mentioned in the "Breaking Changes" sectionrn/feature- A new user-facing feature worth mentioning in the release notesrn/bug-fix- A user-facing bug fix worth mentioning in the release notesrn/documentation- A user-facing documentation change worth mentioning in the release notesShould this PR be included in the next patch release?
Yesshould be selected for bug fixes, documentation updates, and other small changes.Noshould be selected for new features and larger changes. If you're unsure about the release classification of this PR, leave this unchecked to let the maintainers decide.What is a minor/patch release?
Bug fixes, doc updates and new features usually go into minor releases.
Bug fixes and doc updates usually go into patch releases.