-
Notifications
You must be signed in to change notification settings - Fork 885
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(framework) Migrate ID handling from sint64 to uint64 #4170
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks fine to me. Minor comment about whether we should use parameterize
for the test cases. I'm unfamiliar with sqlite_state.py
so I did not review it. Perhaps @panh99 can give feedback there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks good to me generally. However, I am a bit concerned about how users gonna send/receive these IDs. For now, our major grpc messages like Scalar
and ConfigsRecordValue
do not support uint64
. They only support sint64
. This might prevent our users from storing IDs, e.g., node_id
, in grpc messages. We may need to update Scalar
, ConfigsRecordValue
definitions and their serialization functions in serde.py
accordingly.
Co-authored-by: Heng Pan <pan@flower.ai> Co-authored-by: Daniel J. Beutel <daniel@flower.ai>
This PR updates the ID generation to use
uint64
. To ensure compatibility with SQLite, which usessint64
, the IDs are converted as follows:During Save: Convert
uint64
IDs tosint64
before storing in SQLite.During Read: Convert
sint64
IDs back touint64
after retrieving from SQLite.