Skip to content

Commit

Permalink
fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
yanchengnv committed Feb 20, 2025
1 parent fe73c90 commit bc86081
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion nvflare/apis/fl_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ def register_event_handler(self, event_types: Union[str, List[str]], handler, **
if isinstance(event_types, str):
event_types = [event_types]
elif not isinstance(event_types, list):
raise ValueError(f"event_types must be string or list of strings")
raise ValueError(f"event_types must be string or list of strings but got {type(event_types)}")

if not callable(handler):
raise ValueError(f"handler {handler.__name__} is not callable")
Expand Down
5 changes: 2 additions & 3 deletions nvflare/app_common/executors/ete.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,14 @@ def get_task_result(self, fl_ctx: FLContext) -> Shareable:
pass

def _handle_edge_request(self, event_type: str, fl_ctx: FLContext):
self.log_debug(fl_ctx, f"handling event {event_type}")
if not self.current_task:
self.logger.debug(f"received edge request but I don't have pending task")
self.logger.debug(f"received edge event {event_type} but I don't have pending task")
return

try:
msg = fl_ctx.get_prop(FLContextKey.CELL_MESSAGE)
assert isinstance(msg, CellMessage)
self.log_info(fl_ctx, f"received edge request: {msg.payload}")
self.log_debug(fl_ctx, f"received edge request: {msg.payload}")
reply = self.process_edge_request(request=msg.payload, fl_ctx=fl_ctx)
fl_ctx.set_prop(FLContextKey.TASK_RESULT, reply, private=True, sticky=False)
except Exception as ex:
Expand Down
1 change: 0 additions & 1 deletion nvflare/private/defs.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
# this import is to let existing scripts import from nvflare.private.defs
from nvflare.fuel.f3.cellnet.defs import CellChannel, CellChannelTopic, SSLConstants # noqa: F401
from nvflare.fuel.f3.cellnet.utils import new_cell_message # noqa: F401
from nvflare.fuel.f3.message import Message
from nvflare.fuel.hci.server.constants import ConnProps


Expand Down
2 changes: 1 addition & 1 deletion nvflare/private/fed/client/client_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def _receive_edge_request(self, request: CellMessage):

reply = fl_ctx.get_prop(FLContextKey.TASK_RESULT)
if not reply:
self.logger.debug(f"no result for edge request")
self.logger.debug("no result for edge request")
return make_cell_reply(EdgeStatus.NO_TASK)
else:
self.logger.info(f"sending back edge result: {reply}")
Expand Down

0 comments on commit bc86081

Please sign in to comment.