Skip to content

fix(trainer): validate cache schema and table names - #882

Open
Karman580 wants to merge 1 commit into
kubeflow:mainfrom
Karman580:fix/data-cache-initializer-validation
Open

Karman580 wants to merge 1 commit into
kubeflow:mainfrom
Karman580:fix/data-cache-initializer-validation

Conversation

@Karman580

Copy link
Copy Markdown

What this PR does

Validates that both the schema and table components in DataCacheInitializer.storage_uri are non-empty.

Previously, URIs such as cache://schema/, cache:///table, and cache:/// could pass client-side validation even though the downstream Trainer dataset initializer rejects missing schema or table names.

The validation now rejects empty components before job submission. Valid URIs such as cache://schema/table are still accepted, and the existing error message is unchanged.

Tests

  • Added regression cases for cache://schema/, cache:///table, and cache:/// to the existing parametrized test_data_cache_initializer. These three cases fail without the fix and pass with it.
  • uv run pytest -q kubeflow/trainer/types/types_test.py: 14 passed.
  • uv run pytest -q kubeflow: 700 passed.
  • uv lock --check, ruff check, ruff format --check, and ty check kubeflow/hub (the steps of make verify): all passed.

Related issue

Closes #881

DataCacheInitializer only checked that the cache:// path split into two
components, so cache://schema/, cache:///table and cache:/// passed
client-side validation. The Trainer dataset initializer rejects these at
runtime, which meant a malformed URI was only caught after the TrainJob
was submitted. Require both components to be non-empty so the error is
raised on the client.

Fixes kubeflow#881

Signed-off-by: Karman Singh Talwar <flyingoffkarmansinghtalwar@gmail.com>
@google-oss-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign electronic-waste for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Ready to Merge

Development

Successfully merging this pull request may close these issues.

fix(trainer): DataCacheInitializer accepts empty schema or table name in storage_uri

1 participant