From 255cad36c27d74b49a43b33bc811557e6d5aa283 Mon Sep 17 00:00:00 2001 From: Ezzeri Esa Date: Mon, 12 Feb 2024 22:33:08 -0800 Subject: [PATCH] add asserts for hidden attributes --- modal/functions.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modal/functions.py b/modal/functions.py index 9b81eeed6a..36858d4718 100644 --- a/modal/functions.py +++ b/modal/functions.py @@ -1016,6 +1016,7 @@ async def lookup( @property def tag(self): """mdmd:hidden""" + assert hasattr(self, "_tag") return self._tag @property @@ -1032,6 +1033,7 @@ def env(self) -> FunctionEnv: def get_build_def(self) -> str: """mdmd:hidden""" + assert hasattr(self, "_raw_f") and hasattr(self, "_build_args") return f"{inspect.getsource(self._raw_f)}\n{repr(self._build_args)}" # Live handle methods