CAMEL-24526: camel-djl - reject the zoo tabular applications instead of returning no-op predictors - #25849
Conversation
…of returning no-op predictors The zoo linear/softmax regression predictors were empty "// TODO: impl" stubs whose process() did nothing, so a djl:tabular/linear_regression or tabular/softmax_regression route silently returned the input body unchanged as if it were the prediction (a silent wrong result). The DJL model zoo publishes no tabular regression models, and the input/output types of a tabular model are specific to the user's data, so no generic zoo predictor can exist for these applications. getZooPredictor now throws a clear RuntimeCamelException for the tabular applications, pointing users to the supported custom model+translator path, and the two no-op stub classes are removed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Andrea Cosentino <ancosen@gmail.com>
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
|
🧪 CI tested the following changed modules:
🔬 Scalpel shadow comparison — Scalpel: 9 tested, 28 compile-only — current: 9 all testedMaveniverse Scalpel detected 37 affected modules (current approach: 9).
|
gnodet
left a comment
There was a problem hiding this comment.
Nice fix — the deleted ZooLinearRegressionPredictor and ZooSoftmaxRegressionPredictor were genuine stubs with empty process() methods (// TODO: impl), so replacing them with a clear RuntimeCamelException is the right approach. The error message is actionable, directing users to the custom predictor path which remains fully functional.
One thing I believe is missing:
Upgrade guide entry — This PR changes user-visible behavior: routes using djl:tabular/linear_regression or djl:tabular/softmax_regression in zoo mode previously completed silently (no-op); they now throw a RuntimeCamelException. Per project convention, this should be documented in camel-4x-upgrade-guide-4_23.adoc.
There is direct precedent: CAMEL-22518 (commit 66d00a5f6ab) removed the nlp/word_embedding zoo path under identical circumstances and included an upgrade guide entry in camel-4x-upgrade-guide-4_21.adoc.
AI-generated review on behalf of Guillaume Nodet — verify any suggestions before applying.
Issue
CAMEL-24526
Problem
ZooLinearRegressionPredictorandZooSoftmaxRegressionPredictorwere empty stubs:ModelPredictorProducer.getZooPredictor()routesdjl:tabular/linear_regressionanddjl:tabular/softmax_regression(in zoo mode) to these classes, so the producer did nothing andthe exchange body was passed through unchanged — the input was silently returned as if it were the
model's prediction. This is a silent wrong-result bug: a route appears to run a regression but never
does.
Why not just implement them?
The DJL model zoo publishes no tabular regression models — the test class documents exactly this
(
ModelPredictorProducerTestlines 92–93: "No builtin zoo model available for tabular/linear_regression / softmax_regression"),consistent with the other applications that have no downloadable artifact. Unlike CV (
Image→Classifications) or NLP (String→ …), a tabular model has no fixed input/output type pair and DJLprovides no generic tabular
Translator; those types are specific to the user's data. There istherefore nothing generic a zoo predictor could load or translate. The supported way to run a tabular
model is the custom variant (
CustomTabularPredictor), where the user supplies their ownModeland
Translatorvia the registry.Fix
getZooPredictor()now throws a clearRuntimeCamelExceptionfor the tabular applications,telling the user to provide their own model and translator and use the custom predictor instead —
a loud, actionable failure instead of a silently wrong result.
testGetZooPredictorRejectsTabularApplicationscovering both applications.The custom tabular path (
CustomTabularPredictor) is unchanged and still fully supported.Testing
mvn -pl components/camel-ai/camel-djl test(new test green; existing tests unaffected).mvn -Psourcecheck validategreen (formatter + impsort).Claude Code on behalf of oscerd