Skip to content

Simplify CloudPredictor / FoundationModel signatures - #294

Merged
shchur merged 2 commits into
masterfrom
simplify-signatures
Oct 7, 2026
Merged

shchur merged 2 commits into
masterfrom
simplify-signatures

Conversation

@shchur

@shchur shchur commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Shorten the public signatures by moving rarely used options out of them.

  • Options moved to **kwargs, validated against per-method TypedDicts with Unpack, so IDEs still autocomplete them. Unknown keys raise a TypeError that lists the supported ones.
    • Training jobs (CP fit / fit_predict*, FM predict / predict_proba): job_name, volume_size, custom_image_uri, timeout
    • Batch transform (CP predict / predict_proba): job_name, instance_count, custom_image_uri
    • Deploy (CP / FM deploy): initial_instance_count, volume_size, custom_image_uri
  • Removed instance_count and leaderboard from training methods. Training is always single-instance and the leaderboard is always saved. Passing either logs a warning and the value is ignored. FM predict / predict_proba handle instance_count the same way.
  • Moved image_column / test_data_image_column to MultiModalCloudPredictor. On tabular, fit / predict / predict_proba raise an error pointing to MultiModalCloudPredictor.
  • Keyword-only after the data arguments: CP predict / predict_proba, all of CP / FM deploy, TimeSeriesCloudPredictor.predict, TimeSeriesFoundationModel.predict, TimeSeriesEndpoint.predict.
  • framework_version and backend_overrides stay named everywhere. backend_overrides is now also named on the FM methods, where it used to go through **backend_kwargs.
  • timeout now also works for time series training.
  • The fit_predict plumbing (test_data, extra_ag_args) moved from fit(**kwargs) into a private _fit().

Breaking changes

  • Positional calls now raise TypeError, e.g. predict(df, "s3://..."), deploy("s3://..."), TimeSeriesFoundationModel.predict(data, "target"), TimeSeriesCloudPredictor.predict(data, static_features), TimeSeriesEndpoint.predict(data, known_covariates). Pass these by keyword.
  • Options moved into **kwargs: same names, still keyword arguments, so keyword callers are unaffected. Keys that a method doesn't support now raise TypeError instead of being forwarded unchecked; this affects FM methods, which used to forward their extra keyword arguments to the backend without checking them.
  • leaderboard=False on training methods is ignored with a warning; the leaderboard is always saved.
  • instance_count on training methods (CP fit / fit_predict*, FM predict / predict_proba) is ignored with a warning. It already had no effect.
  • image_column / test_data_image_column are only accepted by MultiModalCloudPredictor.
  • FM backend_overrides is now a named parameter; passing it by keyword works as before.

Docs

The hidden options and backend_overrides are documented under a numpydoc Other Parameters section, after Returns. docs/conf.py registers it as a separate napoleon section; by default napoleon merges it into Parameters.

Testing

  • New tests/unittests/general/test_backend_kwargs.py: forwarding, unknown-key errors, ignored-kwarg warnings (CP and FM), image-column errors and split, the legacy backend_kwargs={...} migration hint, keyword-only calls.
  • fit_predict unit tests now mock _fit instead of fit.

shchur added 2 commits October 7, 2026 13:21
- Move rarely used options (job_name, volume_size, custom_image_uri, timeout,
  instance_count, initial_instance_count) into typed **kwargs, validated
  against per-method TypedDicts; unknown keys raise TypeError.
- Drop instance_count / leaderboard from training methods; passing them logs
  a warning and the value is ignored.
- Move image_column / test_data_image_column to MultiModalCloudPredictor.
- Make options keyword-only after the data arguments in predict, deploy,
  TimeSeriesFoundationModel.predict and TimeSeriesEndpoint.predict.
- Make backend_overrides explicit on FoundationModel methods; add timeout to
  time series training.
- Document the hidden options and backend_overrides under "Other Parameters",
  rendered as a separate section by napoleon.
…tance_count, tailored image-column errors

- Restore the `backend_kwargs` entry in _REMOVED_KWARGS (lost in the **kwargs rename), with a test.
- FoundationModel predict / predict_proba warn about and drop `instance_count` instead of raising.
- Tabular predict / predict_proba point `test_data_image_column` to MultiModalCloudPredictor, like fit.
- Caller-neutral _fit error messages; TimeSeriesCloudPredictor.fit returns Self.
- check_backend_kwargs reads TypedDict keys via __required_keys__ / __optional_keys__.
@shchur
shchur merged commit 29f2a42 into master Oct 7, 2026
9 checks passed
@shchur
shchur deleted the simplify-signatures branch October 7, 2026 14:00
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown

Job PR-294-7d664fa is done.
Docs are uploaded to https://d12sc05jpx1wj5.cloudfront.net/PR-294/7d664fa/index.html

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.

1 participant