lablup / raftify

Experimental High level Raft framework
https://docs.rs/raftify/latest/raftify
Apache License 2.0
36 stars 14 forks source link

feat: Add `omit_heartbeat_log` parameter for python binding #137

Closed broccolism closed 1 month ago

broccolism commented 1 month ago

Changes

broccolism commented 1 month ago

@jopemachine I wanna check if this is working, but when I add the parameter to binding/python/examples/main.py file like this, I get a TypeError.

def build_config(node_id: int, initial_peers: Peers) -> Config:
    raft_cfg = RaftConfig(
        id=node_id,
        election_tick=10,
        heartbeat_tick=3,
        omit_heartbeat_log=True,
    )
 File "/Users/user/Documents/broccolism-git/raft/raftify-forked/binding/python/examples/main.py", line 43, in build_config
    raft_cfg = RaftConfig(
               ^^^^^^^^^^^
TypeError: RaftConfig.__new__() got an unexpected keyword argument 'omit_heartbeat_log'

I have modified raftify.pyi file either, but maybe I need to do something else...?

jopemachine commented 1 month ago

@jopemachine I wanna check if this is working, but when I add the parameter to binding/python/examples/main.py file like this, I get a TypeError.

def build_config(node_id: int, initial_peers: Peers) -> Config:
    raft_cfg = RaftConfig(
        id=node_id,
        election_tick=10,
        heartbeat_tick=3,
        omit_heartbeat_log=True,
    )
 File "/Users/user/Documents/broccolism-git/raft/raftify-forked/binding/python/examples/main.py", line 43, in build_config
    raft_cfg = RaftConfig(
               ^^^^^^^^^^^
TypeError: RaftConfig.__new__() got an unexpected keyword argument 'omit_heartbeat_log'

I have modified raftify.pyi file either, but maybe I need to do something else...?

I have confirmed that the patch is working as expected. Please try uninstalling the package with the command pip uninstall raftify, then reinstall the wheel and try again.

jopemachine commented 1 month ago

Thanks!