@@ -198,11 +198,7 @@ def zip(path: str, network: str):
198198 default = None ,
199199 help = "SF CLI org alias or username. Fetches credentials via `sf org display`." ,
200200)
201- @click .option (
202- "--use-in-feature" ,
203- default = "SearchIndexChunking" ,
204- help = "Feature where this function will be used." ,
205- )
201+ @click .option ("--use-in-feature" , default = None , hidden = True , deprecated = True )
206202def deploy (
207203 path : str ,
208204 name : str ,
@@ -248,17 +244,20 @@ def deploy(
248244 )
249245
250246 if package_type == "function" :
251- # Try to infer use_in_feature from function signature; fall back to
252- # the explicit flag value (defaults to SearchIndexChunking)
247+ # Infer use_in_feature from function signature
253248 entrypoint_path = os .path .join (path , ENTRYPOINT_FILE )
254- inferred = infer_use_in_feature (entrypoint_path )
255- if inferred :
256- use_in_feature = inferred
249+ use_in_feature = infer_use_in_feature (entrypoint_path )
250+ if use_in_feature :
257251 logger .info (f"Inferred use_in_feature: { use_in_feature } " )
258252 else :
259- logger .info (f"Using use_in_feature: { use_in_feature } " )
253+ click .secho (
254+ "Error: Function signature does not match a supported type. "
255+ "Use SearchIndexChunkingV1Request and "
256+ "SearchIndexChunkingV1Response in function signature." ,
257+ fg = "red" ,
258+ )
259+ raise click .Abort ()
260260
261- assert use_in_feature is not None
262261 # Map feature names to Connect API names
263262 mapped_feature = USE_IN_FEATURE_MAPPING_FOR_CONNECT_API .get (
264263 use_in_feature , use_in_feature
0 commit comments