From: Daniele Varrazzo Date: Mon, 2 Aug 2021 14:06:16 +0000 (+0200) Subject: Drop ConnectionInfo.protocol_version. X-Git-Tag: 3.0.dev2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9b1af7cd2b68c3b1d229a722d8efbef4b360c7a5;p=thirdparty%2Fpsycopg.git Drop ConnectionInfo.protocol_version. Of limited utility. Left exposed in the underlying pgconn obecjt. --- diff --git a/docs/api/connections.rst b/docs/api/connections.rst index 8bc980493..a8bdf11de 100644 --- a/docs/api/connections.rst +++ b/docs/api/connections.rst @@ -420,8 +420,6 @@ Connection support objects ``standard_conforming_strings``... See :pq:`PQparameterStatus()` for all the available parameters. - .. autoattribute:: protocol_version - .. rubric:: Objects involved in :ref:`transactions` diff --git a/psycopg/psycopg/conninfo.py b/psycopg/psycopg/conninfo.py index fe3c4f23f..c93db7908 100644 --- a/psycopg/psycopg/conninfo.py +++ b/psycopg/psycopg/conninfo.py @@ -240,13 +240,6 @@ class ConnectionInfo: """ return self.pgconn.backend_pid - @property - def protocol_version(self) -> int: - """ - The frontend/backend protocol currently used. See :pq:`PQprotocolVersion()`. - """ - return self.pgconn.protocol_version - @property def error_message(self) -> str: """ diff --git a/psycopg/psycopg/pq/abc.py b/psycopg/psycopg/pq/abc.py index 385e37323..afa42b49b 100644 --- a/psycopg/psycopg/pq/abc.py +++ b/psycopg/psycopg/pq/abc.py @@ -100,10 +100,6 @@ class PGconn(Protocol): def error_message(self) -> bytes: ... - @property - def protocol_version(self) -> int: - ... - @property def server_version(self) -> int: ... diff --git a/tests/test_conninfo.py b/tests/test_conninfo.py index 100e1e995..611d72a57 100644 --- a/tests/test_conninfo.py +++ b/tests/test_conninfo.py @@ -235,9 +235,6 @@ class TestConnectionInfo: def test_server_version(self, conn): assert conn.info.server_version == conn.pgconn.server_version - def test_protocol_version(self, conn): - assert conn.info.protocol_version >= 3 - def test_error_message(self, conn): assert conn.info.error_message == "" with pytest.raises(psycopg.ProgrammingError) as ex: