chore: refurbish Python code by applying refurb linter rules (#8296)
This commit is contained in:
@@ -115,7 +115,7 @@ class GetWorksheetFieldsTool(BuiltinTool):
|
||||
fields.append(field)
|
||||
fields_list.append(
|
||||
f"|{field['id']}|{field['name']}|{field['type']}|{field['typeId']}|{field['description']}"
|
||||
f"|{field['options'] if field['options'] else ''}|"
|
||||
f"|{field['options'] or ''}|"
|
||||
)
|
||||
|
||||
fields.append(
|
||||
|
@@ -130,7 +130,7 @@ class GetWorksheetPivotDataTool(BuiltinTool):
|
||||
# ]
|
||||
rows = []
|
||||
for row in data["data"]:
|
||||
row_data = row["rows"] if row["rows"] else {}
|
||||
row_data = row["rows"] or {}
|
||||
row_data.update(row["columns"])
|
||||
row_data.update(row["values"])
|
||||
rows.append(row_data)
|
||||
|
@@ -113,7 +113,7 @@ class ListWorksheetRecordsTool(BuiltinTool):
|
||||
result_text = f"Found {result['total']} rows in worksheet \"{worksheet_name}\"."
|
||||
if result["total"] > 0:
|
||||
result_text += (
|
||||
f" The following are {result['total'] if result['total'] < limit else limit}"
|
||||
f" The following are {min(limit, result['total'])}"
|
||||
f" pieces of data presented in a table format:\n\n{table_header}"
|
||||
)
|
||||
for row in rows:
|
||||
|
Reference in New Issue
Block a user