mirror of
https://github.com/hwchase17/langchain.git
synced 2025-10-24 12:17:47 +00:00
chore(cli): add mypy strict checking (#32386)
Co-authored-by: Mason Daugherty <mason@langchain.dev>
This commit is contained in:
committed by
GitHub
parent
444939945a
commit
e3c4aeaea1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user