chore(cli): add mypy strict checking (#32386)

Co-authored-by: Mason Daugherty <mason@langchain.dev>
This commit is contained in:
Christophe Bornet
2025-08-30 20:02:45 +02:00
committed by GitHub
parent 444939945a
commit e3c4aeaea1
9 changed files with 70 additions and 48 deletions

View File

@@ -48,7 +48,8 @@ def create_events(events: list[EventDict]) -> Optional[dict[str, Any]]:
res = conn.getresponse()
return json.loads(res.read())
response_data = json.loads(res.read())
return response_data if isinstance(response_data, dict) else None
except (http.client.HTTPException, OSError, json.JSONDecodeError) as exc:
typer.echo(f"Error sending events: {exc}")
return None