typing - packet.py#73
typing - packet.py#73heehehe merged 8 commits intofeature/typing-gtid-exception-binlogstream-packetfrom
Conversation
|
여러개의 타입 중 하나가 올 수 있는 경우 |
dongwook-chan
left a comment
There was a problem hiding this comment.
제가 잘못 설명드렸음에도 불구하고 찰떡같이 알아들으시고 스마트하게 typing 잘 해주셨습니다! 3조 정말 매번 열심히 해주셔서 정말 감사합니다! 🙇🙇
pymysqlreplication/packet.py
Outdated
| from pymysqlreplication import constants, event, row_event | ||
|
|
||
| from typing import List, Tuple, Dict, Optional, Union | ||
| from pymysql.connections import MysqlPacket |
There was a problem hiding this comment.
Any라고 적고 끝내실수도 있는데 끈질기게 해법을 고민해주셨다는 게 대단한 것 같아요!
끈기는 개발자의 핵심 역량이죠 👍👍👍
다음번에도 막히는 부분 있다면 머리를 맞대어 해결해봅시다!!
There was a problem hiding this comment.
정승님께서 발견해주신 덕분에 잘 바꿀 수 있었습니다ㅎㅎ 넘 감사합니다!!😆
| return string | ||
|
|
||
|
|
||
| def read_offset_or_inline(packet: Union[MysqlPacket, BinLogPacketWrapper], large: bool) \ |
There was a problem hiding this comment.
일단 packet.py가 쉽지 않아 보이던데 엄청 꼼꼼하게 해주셔서 감탄하면서 봤네요 😲😲 고생하셨어요!! 🥰🥰
혹시 이 함수가 밑으로 옮겨진 이유가 따로 있을까요? 오류는 아니고 궁금해서 여쭤봅니다...!
There was a problem hiding this comment.
감사합니다🥺
packet type으로 BinLogPacketWrapper를 사용해야 하는데 위에 있으면 이게 정의되어 있지 않다고 나오더라구요..!
그래서 아래로 옮겨뒀습니다 :) (upstream PR 올릴 때 코멘트로 설명 달아야겠네요!)
|
고생 많으셨어요! Typing을 엄청 꼼꼼하게 잘 해주신거 같아서 한 수 배워가네요 👍 |
|
수고 많으셨습니다!! 정말 꼼꼼한 Typing 인 것 같아요! 많이 배웠습니다~~!!! |
… feature/typing-packet
| def read_length_coded_pascal_string(self, size: int) -> Union[int, bytes]: | ||
| """ | ||
| Read a string with length coded using pascal style. | ||
| The string start by the size of the string | ||
| """ | ||
| length = self.read_uint_by_size(size) | ||
| return self.read(length) |
There was a problem hiding this comment.
어떤경우에 int가 나오고 어떤경우 byte가나오나요?
There was a problem hiding this comment.
원래는 아래 부분에서 if len(self.__data_buffer) > 0이면 bytes로 되고 아니면 int로 된다고 생각했는데요..
https://github.com/23-OSSCA-python-mysql-replication/python-mysql-replication/blob/4ccf81ad8024c43bfd9b7b0e8ffbca51e3657e86/pymysqlreplication/packet.py#L154-L164
pymysql 코드 살펴보니까 모두 bytes로 반환될 것 같네요..!
https://github.com/PyMySQL/PyMySQL/blob/8157da51e844f619eb693c5f5dd2758dca1d1c98/pymysql/protocol.py#L62-L76
자세히 살펴봐주셔서 감사합니다 수정해볼게요!! - 4c1286c 반영 완료
To Do
__init__