Skip to content

Commit

Permalink
Drop a bit of dead code
Browse files Browse the repository at this point in the history
The `cache_key` argument to `ConnectionSettings` is unused.
  • Loading branch information
elprans committed Jul 17, 2024
1 parent 11101c6 commit 98aebf1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion asyncpg/protocol/codecs/base.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ cdef uint32_t pylong_as_oid(val) except? 0xFFFFFFFFl:


cdef class DataCodecConfig:
def __init__(self, cache_key):
def __init__(self):
# Codec instance cache for derived types:
# composites, arrays, ranges, domains and their combinations.
self._derived_type_codecs = {}
Expand Down
2 changes: 1 addition & 1 deletion asyncpg/protocol/protocol.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ class Codec:

class DataCodecConfig:
__pyx_vtable__: Any
def __init__(self, cache_key: object) -> None: ...
def __init__(self) -> None: ...
def add_python_codec(
self,
typeoid: int,
Expand Down
4 changes: 2 additions & 2 deletions asyncpg/protocol/settings.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ from asyncpg import exceptions
@cython.final
cdef class ConnectionSettings(pgproto.CodecContext):

def __cinit__(self, conn_key):
def __cinit__(self):
self._encoding = 'utf-8'
self._is_utf8 = True
self._settings = {}
self._codec = codecs.lookup('utf-8')
self._data_codecs = DataCodecConfig(conn_key)
self._data_codecs = DataCodecConfig()

cdef add_setting(self, str name, str val):
self._settings[name] = val
Expand Down

0 comments on commit 98aebf1

Please sign in to comment.