Skip to content

Commit

Permalink
Set BytesType to 8 bytes for BIT since size is 1<=M<=64
Browse files Browse the repository at this point in the history
  • Loading branch information
criccomini committed Aug 10, 2023
1 parent 3a74cbf commit 92d03c2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions recap/readers/mysql.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ def get_recap_type(self, column_props: dict[str, Any]) -> RecapType:
byte_length = ceil(max_length / 8)
base_type = BytesType(bytes_=byte_length, variable=False)
elif data_type.startswith("bit"):
byte_length = ceil(max_length / 8)
base_type = BytesType(bytes_=byte_length, variable=False)
base_type = BytesType(bytes_=8, variable=False)
elif data_type.startswith("timestamp") or data_type.startswith("datetime"):
dt_precision = column_props["DATETIME_PRECISION"]
unit = self._get_time_unit([dt_precision]) or "microsecond"
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/readers/test_mysql.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def test_struct_method(self):
UnionType(
default=None,
name="test_bit",
types=[NullType(), BytesType(bytes_=2, variable=False)],
types=[NullType(), BytesType(bytes_=8, variable=False)],
),
UnionType(
default=None,
Expand Down

0 comments on commit 92d03c2

Please sign in to comment.