Skip to content

Remove protocol < 3 support #490

Open
@mykaul

Description

@mykaul

Just as was done for the GoCQL driver (scylladb/gocql#457 and others), we should remove ancient protocol support. It's not such a big deal, but there's always an 'if' in the serialization and so forth.
Example:

class _SimpleParameterizedType(_ParameterizedType):
    @classmethod
    def deserialize_safe(cls, byts, protocol_version):
        subtype, = cls.subtypes
        if protocol_version >= 3:
            unpack = int32_unpack
            length = 4
        else:
            unpack = uint16_unpack
            length = 2

Or:

    def serialize_safe(cls, items, protocol_version):
        if isinstance(items, str):
            raise TypeError("Received a string for a type that expects a sequence")

        subtype, = cls.subtypes
        pack = int32_pack if protocol_version >= 3 else uint16_pack

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions