@@ -198,11 +198,6 @@ 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- )
206201def deploy (
207202 path : str ,
208203 name : str ,
@@ -212,7 +207,6 @@ def deploy(
212207 profile : str ,
213208 network : str ,
214209 sf_cli_org : Optional [str ],
215- use_in_feature : Optional [str ],
216210):
217211 from datacustomcode .constants import USE_IN_FEATURE_MAPPING_FOR_CONNECT_API
218212 from datacustomcode .deploy import (
@@ -248,17 +242,20 @@ def deploy(
248242 )
249243
250244 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)
245+ # Infer use_in_feature from function signature
253246 entrypoint_path = os .path .join (path , ENTRYPOINT_FILE )
254- inferred = infer_use_in_feature (entrypoint_path )
255- if inferred :
256- use_in_feature = inferred
247+ use_in_feature = infer_use_in_feature (entrypoint_path )
248+ if use_in_feature :
257249 logger .info (f"Inferred use_in_feature: { use_in_feature } " )
258250 else :
259- logger .info (f"Using use_in_feature: { use_in_feature } " )
251+ click .secho (
252+ "Error: Function signature does not match a supported type. "
253+ "Use SearchIndexChunkingV1Request and "
254+ "SearchIndexChunkingV1Response in function signature." ,
255+ fg = "red" ,
256+ )
257+ raise click .Abort ()
260258
261- assert use_in_feature is not None
262259 # Map feature names to Connect API names
263260 mapped_feature = USE_IN_FEATURE_MAPPING_FOR_CONNECT_API .get (
264261 use_in_feature , use_in_feature
0 commit comments