Skip to content

Commit

Permalink
Improve typing and return value of get_last_log in EntityComponent.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 650018400
Change-Id: I473a7a2b76186089a9c87c355ce4ef0465fcc915
  • Loading branch information
duenez authored and Copybara-Service committed Jul 7, 2024
1 parent 9cbd8a4 commit b63eb0c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions concordia/typing/component_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,17 @@
import abc
from collections.abc import Mapping
import enum
import types
from typing import Any

from concordia.typing import entity as entity_lib

ComponentName = str
ComponentContext = str
ComponentContextMapping = Mapping[ComponentName, ComponentContext]

_EMPTY_MAPPING = types.MappingProxyType({})


class Phase(enum.Enum):
"""Phases of a component entity lifecycle.
Expand Down Expand Up @@ -180,9 +184,9 @@ def update(

def get_last_log(
self,
):
) -> Mapping[str, Any]:
"""Returns a dictionary with latest log of activity."""
return None
return _EMPTY_MAPPING


class ActingComponent(BaseComponent, metaclass=abc.ABCMeta):
Expand Down

0 comments on commit b63eb0c

Please sign in to comment.