Skip to content

[Online Scoring][6.1/x] Add IS NULL / IS NOT NULL comparator support for trace metadata filtering#19720

Merged
dbczumar merged 114 commits intomlflow:masterfrom
dbczumar:stack/pr6ahalf-is-null-filter
Jan 9, 2026
Merged

[Online Scoring][6.1/x] Add IS NULL / IS NOT NULL comparator support for trace metadata filtering#19720
dbczumar merged 114 commits intomlflow:masterfrom
dbczumar:stack/pr6ahalf-is-null-filter

Conversation

@dbczumar
Copy link
Collaborator

@dbczumar dbczumar commented Jan 1, 2026

🥞 Stacked PR

Use this link to review incremental changes.


Related Issues/PRs

#xxx

What changes are proposed in this pull request?

Support filtering traces based on whether a particular piece of metadata is null or not null. not null filtering is required for online scoring, since evaluation runs need to be excluded.

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

Release Notes

search_traces() now supports is null / is not null filtering for trace metadata

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)

Add SCORER_BACKEND_TRACKING and SCORER_BACKEND_DATABRICKS constants
to replace hardcoded string literals throughout the codebase.

Signed-off-by: dbczumar <corey.zumar@databricks.com>
- Add inline comments clarifying that each scorer has at most one online
  configuration, as guaranteed by the server
- Use set comprehension in list_scorer_versions to eliminate duplicate
  scorer_ids before querying online configs

Signed-off-by: dbczumar <corey.zumar@databricks.com>
Add infrastructure utilities for online scoring of traces:
- OnlineScorerSampler: Handles sampling logic for scorers
- OnlineTraceCheckpointManager: Tracks last processed trace
- OnlineTraceLoader: Fetches traces from tracking store
- Constants for online scoring configuration
- Environment variable for max workers
- Assessment metadata key for session ID

Signed-off-by: dbczumar <corey.zumar@databricks.com>
Signed-off-by: dbczumar <corey.zumar@databricks.com>
Signed-off-by: dbczumar <corey.zumar@databricks.com>
…n scoring

Signed-off-by: dbczumar <corey.zumar@databricks.com>
- Remove ONLINE_SCORING_SESSION_ID constant (added to PR 8 where needed)
- Restore job.py to PR 5 state (run_online_trace_scorer_job belongs in PR 6c)
- Fix entities.py class ordering (OnlineScoringConfig first)

Signed-off-by: dbczumar <corey.zumar@databricks.com>
Signed-off-by: dbczumar <corey.zumar@databricks.com>
Use 'not supported' instead of 'cannot apply' and 'currently only
supported' instead of 'only work' for more formal/professional tone.

Signed-off-by: dbczumar <corey.zumar@databricks.com>
…scorers_by_filter

Signed-off-by: dbczumar <corey.zumar@databricks.com>
Signed-off-by: dbczumar <corey.zumar@databricks.com>
Signed-off-by: dbczumar <corey.zumar@databricks.com>
Signed-off-by: dbczumar <corey.zumar@databricks.com>
Signed-off-by: dbczumar <corey.zumar@databricks.com>
Signed-off-by: dbczumar <corey.zumar@databricks.com>
- Add inline comments to OnlineTraceScoringCheckpoint fields explaining
  timestamp_ms and trace_id (used as tie breaker for same timestamp)
- Fix OnlineScorer import to use online.entities instead of online.processor

Signed-off-by: dbczumar <corey.zumar@databricks.com>
Access sample_rate and filter_string through online_config property
instead of directly on OnlineScorer entity.

Signed-off-by: dbczumar <corey.zumar@databricks.com>
Update make_online_scorer helper to create OnlineScorer with
online_config property containing OnlineScoringConfig entity.

Signed-off-by: dbczumar <corey.zumar@databricks.com>
Replace manual key existence check with defaultdict(list) to simplify
the grouping logic.

Signed-off-by: dbczumar <corey.zumar@databricks.com>
Add IS NULL comparator support to search_utils for trace metadata
filtering, enabling queries to filter traces where specific metadata
fields are not set.

Signed-off-by: dbczumar <corey.zumar@databricks.com>
Signed-off-by: dbczumar <corey.zumar@databricks.com>
Signed-off-by: dbczumar <corey.zumar@databricks.com>
Signed-off-by: dbczumar <corey.zumar@databricks.com>
Signed-off-by: dbczumar <corey.zumar@databricks.com>
Signed-off-by: dbczumar <corey.zumar@databricks.com>
The second handler for IS NOT NULL (checking for separate NOT and NULL
tokens) is unreachable with sqlparse >= 0.5.3, which always parses
"NOT NULL" as a single keyword token. Testing confirms this pattern
holds across various whitespace configurations.

Signed-off-by: dbczumar <corey.zumar@databricks.com>
Signed-off-by: dbczumar <corey.zumar@databricks.com>
Signed-off-by: dbczumar <corey.zumar@databricks.com>
Signed-off-by: dbczumar <corey.zumar@databricks.com>
Signed-off-by: dbczumar <corey.zumar@databricks.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/tracing MLflow Tracing and its integrations rn/feature Mention under Features in Changelogs.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants