Skip to content

Add support for IS NULL and IS NOT NULL comparators in experiment tags#21148

Merged
TomeHirata merged 8 commits intomlflow:masterfrom
TomeHirata:feat/experiment/null-search
Feb 26, 2026
Merged

Add support for IS NULL and IS NOT NULL comparators in experiment tags#21148
TomeHirata merged 8 commits intomlflow:masterfrom
TomeHirata:feat/experiment/null-search

Conversation

@TomeHirata
Copy link
Collaborator

Related Issues/PRs

n/a

What changes are proposed in this pull request?

As titled

How is this PR tested?

  • Existing unit/integration tests
  • New unit/integration tests
  • Manual tests

Does this PR require documentation update?

  • No. You can skip the rest of this section.
  • Yes. I've updated:
    • Examples
    • API references
    • Instructions

Does this PR require updating the MLflow Skills repository?

  • No. You can skip the rest of this section.
  • Yes. Please link the corresponding PR or explain how you plan to update it.

Release Notes

Is this a user-facing change?

  • No. You can skip the rest of this section.
  • Yes. Give a description of this change to be included in the release notes for MLflow users.

What component(s), interfaces, languages, and integrations does this PR affect?

Components

  • area/tracking: Tracking Service, tracking client APIs, autologging
  • area/models: MLmodel format, model serialization/deserialization, flavors
  • area/model-registry: Model Registry service, APIs, and the fluent client calls for Model Registry
  • area/scoring: MLflow Model server, model deployment tools, Spark UDFs
  • area/evaluation: MLflow model evaluation features, evaluation metrics, and evaluation workflows
  • area/gateway: MLflow AI Gateway client APIs, server, and third-party integrations
  • area/prompts: MLflow prompt engineering features, prompt templates, and prompt management
  • area/tracing: MLflow Tracing features, tracing APIs, and LLM tracing functionality
  • area/projects: MLproject format, project running backends
  • area/uiux: Front-end, user experience, plotting, JavaScript, JavaScript dev server
  • area/build: Build and test infrastructure for MLflow
  • area/docs: MLflow documentation pages

How 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" section
  • rn/breaking-change - The PR will be mentioned in the "Breaking Changes" section
  • rn/feature - A new user-facing feature worth mentioning in the release notes
  • rn/bug-fix - A user-facing bug fix worth mentioning in the release notes
  • rn/documentation - A user-facing documentation change worth mentioning in the release notes

Should this PR be included in the next patch release?

Yes should be selected for bug fixes, documentation updates, and other small changes. No should 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?
  • Minor release: a release that increments the second part of the version number (e.g., 1.2.0 -> 1.3.0).
    Bug fixes, doc updates and new features usually go into minor releases.
  • Patch release: a release that increments the third part of the version number (e.g., 1.2.0 -> 1.2.1).
    Bug fixes and doc updates usually go into patch releases.
  • Yes (this PR will be cherry-picked and included in the next patch release)
  • No (this PR will be included in the next minor release)

… searches

Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
@github-actions github-actions bot added size/M v3.10.1 area/tracking Tracking service, tracking client APIs, autologging rn/none List under Small Changes in Changelogs. labels Feb 26, 2026
@github-actions
Copy link
Contributor

🛠 DevTools 🛠

Install mlflow from this PR

# mlflow
pip install git+https://github.com/mlflow/mlflow.git@refs/pull/21148/merge
# mlflow-skinny
pip install git+https://github.com/mlflow/mlflow.git@refs/pull/21148/merge#subdirectory=libs/skinny

For Databricks, use the following command:

%sh curl -LsSf https://raw.githubusercontent.com/mlflow/mlflow/HEAD/dev/install-skinny.sh | sh -s pull/21148/merge

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 NULL and IS NOT NULL as 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)

Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
@github-actions
Copy link
Contributor

github-actions bot commented Feb 26, 2026

Documentation preview for f6c3d7a is available at:

Changed Pages (1)

More info
  • Ignore this comment if this PR does not change the documentation.
  • The preview is updated when a new commit is pushed to this PR.
  • This comment was created by this workflow run.
  • The documentation was built by this workflow run.

…tion

Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>


def _join_in_comparison_tokens(tokens, search_traces=False):
def _join_in_comparison_tokens(tokens, search_traces=False, search_null_operators=False):
Copy link
Collaborator

@WeichenXu123 WeichenXu123 Feb 26, 2026

Choose a reason for hiding this comment

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

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.

Copy link
Collaborator Author

@TomeHirata TomeHirata Feb 26, 2026

Choose a reason for hiding this comment

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

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:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we override _validate_comparison instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good call

Copy link
Collaborator

@serena-ruan serena-ruan left a comment

Choose a reason for hiding this comment

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

Overall LGTM!

TomeHirata and others added 2 commits February 26, 2026 17:27
- 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>
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
@TomeHirata TomeHirata added this pull request to the merge queue Feb 26, 2026
Merged via the queue into mlflow:master with commit 3d98108 Feb 26, 2026
51 of 52 checks passed
@TomeHirata TomeHirata deleted the feat/experiment/null-search branch February 26, 2026 11:52
@github-actions github-actions bot added size/L Large PR (200-499 LoC) and removed size/M labels Feb 26, 2026
daniellok-db pushed a commit to daniellok-db/mlflow that referenced this pull request Mar 5, 2026
mlflow#21148)

Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
daniellok-db pushed a commit to daniellok-db/mlflow that referenced this pull request Mar 5, 2026
mlflow#21148)

Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
daniellok-db pushed a commit that referenced this pull request Mar 5, 2026
#21148)

Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/tracking Tracking service, tracking client APIs, autologging rn/none List under Small Changes in Changelogs. size/L Large PR (200-499 LoC) v3.10.1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants