Skip to content

Conversation

@czgdp1807
Copy link
Collaborator

@czgdp1807 czgdp1807 commented Dec 19, 2025

Summary

This PR implements comprehensive deprecation warnings for the filter_query parameter in ListOperationOptions that depends on ZetaSQL. This prepares for the removal of ZetaSQL dependency from ML Metadata in version 1.18.0.

Motivation

ZetaSQL dependency is being phased out from ML Metadata. The filter_query feature relies on ZetaSQL for SQL query parsing and analysis. To maintain backward compatibility while communicating the planned removal, this PR adds proper deprecation warnings across the codebase.

Changes

Runtime Warnings

  • Python API (metadata_store.py): Added DeprecationWarning when filter_query is used in ListOptions
  • C++ Query Executors: Added LOG(WARNING) messages in:
    • query_config_executor.cc (MySQL)
    • postgresql_query_executor.cc (PostgreSQL)

Documentation Updates

  • RELEASE.md: Added deprecation notice in Current Version section with v1.19.0 removal timeline
  • ListOptions docstring: Updated to clearly mark filter_query as deprecated with migration guidance
  • C++ Headers & Implementations: Added deprecation comments to:
    • filter_query_ast_resolver.h and .cc
    • filter_query_builder.h and .cc

Test Updates

  • Modified test_get_nodes_by_filter_query to verify DeprecationWarning is raised
  • Modified test_get_nodes_by_filter_query_syntax_errors to verify warnings even on syntax errors
  • Added warning suppression (warnings.catch_warnings()) to lineage subgraph tests that use filter_query for backward compatibility testing
  • All deprecation warnings properly tested with assertions on warning message content

Timeline

  • v1.17.1 (next release): Deprecation warnings introduced
  • v1.18.0: Complete removal of filter_query and ZetaSQL dependency

Testing

All tests pass with proper deprecation warning handling:

  • Tests explicitly verify warnings are raised when filter_query is used
  • Backward compatibility tests suppress warnings while noting the deprecated functionality
  • No functional changes to existing behavior

Migration Path

Users relying on filter_query should migrate to alternative filtering approaches before v1.18.0. The deprecation warnings provide clear guidance on the timeline and necessary actions.

@czgdp1807 czgdp1807 changed the title Deprecate ZetaSQL-based filter_query functionality for v1.19.0 removal Deprecate ZetaSQL-based filter_query functionality for v1.19.0 removal Dec 19, 2025
@czgdp1807 czgdp1807 marked this pull request as ready for review December 19, 2025 17:31
@czgdp1807 czgdp1807 changed the title Deprecate ZetaSQL-based filter_query functionality for v1.19.0 removal Deprecate ZetaSQL-based filter_query functionality for v1.18.0 removal Jan 16, 2026
@czgdp1807
Copy link
Collaborator Author

czgdp1807 commented Jan 16, 2026

@aktech @vkarampudi I have updated the title, description and commit messages as per the plan we discussed (to remove ZetaSQL in 1.18.0 release). We should merge this PR before v1.17.1 release (i.e., the next one).

filter_query: An optional boolean expression in SQL syntax to specify
conditions on node attributes and directly connected assets. See
https://github.com/google/ml-metadata/blob/master/ml_metadata/proto/metadata_store.proto#L705-L783 for the query capabilities and syntax.
filter_query: DEPRECATED (will be removed in v1.19.0) - An optional boolean
Copy link
Collaborator

Choose a reason for hiding this comment

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

The PR description states removal in v1.18.0, but comment here says v1.19.0 and everywhere below.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes. The plan was changed later. Let me make the updates quickly. I was busy with struct2tensor. My 100% focus and time was allocated there (and finally we did it). Now let me clean this PR.

@aktech
Copy link
Collaborator

aktech commented Jan 23, 2026

@czgdp1807 I see a bunch of examples here https://github.com/google/ml-metadata/blob/93574251a56d29f3775dd980daf5dbfbd58840cd/docs/index.md which uses filter_query in examples, we need to add note add those places regarding deprecation.

Deprecate filter_query parameter in ListOperationOptions that depends on
ZetaSQL. Add runtime warnings (Python DeprecationWarning, C++ LOG(WARNING)),
update documentation, and add test coverage for deprecation warnings.

This prepares for removal of ZetaSQL dependency in version 1.18.0.
Add deprecation notes to documentation examples and update version references from 1.19.0 to 1.18.0 across Python, C++, and documentation files.
@czgdp1807
Copy link
Collaborator Author

This is ready to merge. The tests will pass.

cc: @aktech

@aktech aktech merged commit 00f80a7 into google:master Jan 23, 2026
17 checks passed
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