@@ -142,7 +142,7 @@ def soql(query: str) -> List[Dict[str, Any]]:
142142 # Remove 'attributes' field from each record for cleaner output
143143 if "records" not in result :
144144 raise ValueError (f"Unexpected SOQL response format: missing 'records' field in { result } " )
145-
145+
146146 records = result ["records" ]
147147 return [{k : v for k , v in record .items () if k != "attributes" } for record in records ]
148148
@@ -167,8 +167,10 @@ def sosl(query: str) -> List[Dict[str, Any]]:
167167
168168 # Return the searchRecords directly as a list
169169 if "searchRecords" not in result :
170- raise ValueError (f"Unexpected SOSL response format: missing 'searchRecords' field in { result } " )
171-
170+ raise ValueError (
171+ f"Unexpected SOSL response format: missing 'searchRecords' field in { result } "
172+ )
173+
172174 search_records : List [Dict [str , Any ]] = result ["searchRecords" ]
173175 return search_records
174176
@@ -211,13 +213,15 @@ def list_sobjects(filter: Optional[str] = None) -> List[str]:
211213
212214 if not describe_result :
213215 raise ValueError ("Salesforce describe() returned empty result" )
214-
216+
215217 if "sobjects" not in describe_result :
216- raise ValueError (f"Unexpected describe response format: missing 'sobjects' field in { describe_result } " )
217-
218+ raise ValueError (
219+ f"Unexpected describe response format: missing 'sobjects' field in { describe_result } "
220+ )
221+
218222 sobjects = describe_result ["sobjects" ]
219223 object_names = []
220-
224+
221225 for obj in sobjects :
222226 if not isinstance (obj , dict ):
223227 raise ValueError (f"Unexpected sobject format: expected dict, got { type (obj )} : { obj } " )
@@ -261,21 +265,25 @@ def describe_sobject(sobject_name: str) -> Dict[str, Any]:
261265
262266 if not describe_result :
263267 raise ValueError (f"Salesforce object '{ sobject_name } ' describe() returned empty result" )
264-
268+
265269 if "fields" not in describe_result :
266- raise ValueError (f"Unexpected describe response format for '{ sobject_name } ': missing 'fields' field in { describe_result } " )
270+ raise ValueError (
271+ f"Unexpected describe response format for '{ sobject_name } ': missing 'fields' field in { describe_result } "
272+ )
267273
268274 # Process fields into the required format
269275 fields_info = {}
270276 for field in describe_result ["fields" ]:
271277 if not isinstance (field , dict ):
272- raise ValueError (f"Unexpected field format in '{ sobject_name } ': expected dict, got { type (field )} : { field } " )
273-
278+ raise ValueError (
279+ f"Unexpected field format in '{ sobject_name } ': expected dict, got { type (field )} : { field } "
280+ )
281+
274282 required_fields = ["name" , "type" , "label" ]
275283 for required_field in required_fields :
276284 if required_field not in field :
277285 raise ValueError (f"Field missing '{ required_field } ' in '{ sobject_name } ': { field } " )
278-
286+
279287 field_name = field ["name" ]
280288 field_info = {"type" : field ["type" ], "label" : field ["label" ]}
281289
0 commit comments