From eb11a0b1834aba4796e21c0e6d3f9c7f0f2375c8 Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Sun, 1 May 2022 22:44:37 +0200 Subject: [PATCH] refactor: replace an assert with a type: ignore It's not like we give away opcodes for free here. --- psycopg/psycopg/cursor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/psycopg/psycopg/cursor.py b/psycopg/psycopg/cursor.py index 0e549e084..0a534d563 100644 --- a/psycopg/psycopg/cursor.py +++ b/psycopg/psycopg/cursor.py @@ -743,8 +743,8 @@ class Cursor(BaseCursor["Connection[Any]", Row]): self._conn.wait(self._stream_send_gen(query, params, binary=binary)) first = True while self._conn.wait(self._stream_fetchone_gen(first)): - rec = self._tx.load_row(0, self._make_row) - assert rec is not None + # We know that, if we got a result, it has a single row. + rec: Row = self._tx.load_row(0, self._make_row) # type: ignore yield rec first = False -- 2.47.2