@@ -108,7 +108,7 @@ def einstein_predict_col(
108108 def _predict (values_row : Any ) -> Dict [str , Optional [str ]]:
109109 if values_row is None :
110110 # An entirely null features struct is not the normal per-feature null
111- # case; surface it directly rather than masking it (local debuggability).
111+ # case; surface it directly rather than masking it (debuggability).
112112 return {
113113 "status" : _STATUS_ERROR ,
114114 "response" : None ,
@@ -227,19 +227,17 @@ def _invoke_predictions(
227227 except EinsteinPredictionsCallError :
228228 raise
229229 except Exception as exc :
230- # Transport/build failures: surface the real error (no masking) so local runs stay
231- # debuggable. error_code stays None since there is no HTTP status.
230+ # Transport/build failures: surface the real error (no masking) so local
231+ # runs stay debuggable. error_code stays None since there is no HTTP status.
232232 raise EinsteinPredictionsCallError (
233233 f"Einstein Predictions call failed: { exc } " ,
234234 status = None ,
235235 error_code = None ,
236236 error_message = str (exc ),
237- )
237+ ) from exc
238238
239239 if response .status_code != _HTTP_OK :
240- error_message = (
241- json .dumps (response .data ) if response .data is not None else None
242- )
240+ error_message = json .dumps (response .data ) if response .data is not None else None
243241 raise EinsteinPredictionsCallError (
244242 f"Einstein Predictions call failed: "
245243 f"status_code={ response .status_code } , message={ error_message !r} " ,
@@ -267,8 +265,8 @@ def _invoke_predictions_as_struct(
267265 "error_message" : _null_feature_message (null_feature ),
268266 }
269267
270- # (b) Transport/build failures — surface the real error (no masking) so local runs stay
271- # debuggable. error_code stays None since there is no HTTP status.
268+ # (b) Transport/build failures — surface the real error (no masking) so local
269+ # runs stay debuggable. error_code stays None since there is no HTTP status.
272270 try :
273271 response = _call_predictions (
274272 predictions , model_api_name , prediction_type , features , settings
0 commit comments