diff --git a/src/pydase/data_service/data_service.py b/src/pydase/data_service/data_service.py index 3c1d12d..e8183b8 100644 --- a/src/pydase/data_service/data_service.py +++ b/src/pydase/data_service/data_service.py @@ -70,7 +70,7 @@ class DataService(rpyc.Service, AbstractDataService): # every class defined by the user should inherit from DataService if it is # assigned to a public attribute - if not __name.startswith("_"): + if not __name.startswith("_") and not inspect.isfunction(__value): self.__warn_if_not_observable(__value) # Set the attribute diff --git a/tests/data_service/test_data_service.py b/tests/data_service/test_data_service.py index c0e0550..406b666 100644 --- a/tests/data_service/test_data_service.py +++ b/tests/data_service/test_data_service.py @@ -56,6 +56,9 @@ def test_basic_inheritance_warning(caplog: LogCaptureFixture) -> None: def some_method(self) -> None: ... + async def some_task(self) -> None: + ... + ServiceClass() # neither of the attributes, methods or properties cause a warning log