|
60 | 60 | TimestampType, |
61 | 61 | TimestamptzType, |
62 | 62 | TimeType, |
| 63 | + UnknownType, |
63 | 64 | UUIDType, |
64 | 65 | ) |
65 | 66 |
|
@@ -531,8 +532,10 @@ def primitive(self, primitive: PrimitiveType, primitive_partner: Optional[P]) -> |
531 | 532 | return self.visit_fixed(primitive, primitive_partner) |
532 | 533 | elif isinstance(primitive, BinaryType): |
533 | 534 | return self.visit_binary(primitive, primitive_partner) |
| 535 | + elif isinstance(primitive, UnknownType): |
| 536 | + return self.visit_unknown(primitive, primitive_partner) |
534 | 537 | else: |
535 | | - raise ValueError(f"Unknown type: {primitive}") |
| 538 | + raise ValueError(f"Type not recognized: {primitive}") |
536 | 539 |
|
537 | 540 | @abstractmethod |
538 | 541 | def visit_boolean(self, boolean_type: BooleanType, partner: Optional[P]) -> T: |
@@ -590,6 +593,10 @@ def visit_fixed(self, fixed_type: FixedType, partner: Optional[P]) -> T: |
590 | 593 | def visit_binary(self, binary_type: BinaryType, partner: Optional[P]) -> T: |
591 | 594 | """Visit a BinaryType.""" |
592 | 595 |
|
| 596 | + @abstractmethod |
| 597 | + def visit_unknown(self, unknown_type: UnknownType, partner: Optional[P]) -> T: |
| 598 | + """Visit a UnknownType.""" |
| 599 | + |
593 | 600 |
|
594 | 601 | class PartnerAccessor(Generic[P], ABC): |
595 | 602 | @abstractmethod |
@@ -707,8 +714,10 @@ def primitive(self, primitive: PrimitiveType) -> T: |
707 | 714 | return self.visit_uuid(primitive) |
708 | 715 | elif isinstance(primitive, BinaryType): |
709 | 716 | return self.visit_binary(primitive) |
| 717 | + elif isinstance(primitive, UnknownType): |
| 718 | + return self.visit_unknown(primitive) |
710 | 719 | else: |
711 | | - raise ValueError(f"Unknown type: {primitive}") |
| 720 | + raise ValueError(f"Type not recognized: {primitive}") |
712 | 721 |
|
713 | 722 | @abstractmethod |
714 | 723 | def visit_fixed(self, fixed_type: FixedType) -> T: |
@@ -766,6 +775,10 @@ def visit_uuid(self, uuid_type: UUIDType) -> T: |
766 | 775 | def visit_binary(self, binary_type: BinaryType) -> T: |
767 | 776 | """Visit a BinaryType.""" |
768 | 777 |
|
| 778 | + @abstractmethod |
| 779 | + def visit_unknown(self, unknown_type: UnknownType) -> T: |
| 780 | + """Visit a UnknownType.""" |
| 781 | + |
769 | 782 |
|
770 | 783 | @dataclass(init=True, eq=True, frozen=True) |
771 | 784 | class Accessor: |
|
0 commit comments