From d01ffa04ce94d6eee48a80a99e344d2aaf99ca15 Mon Sep 17 00:00:00 2001 From: Erik Bernhardsson Date: Mon, 29 Jul 2024 18:17:51 -0400 Subject: [PATCH] clean up assertion in resolver (#2057) --- modal/_resolver.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/modal/_resolver.py b/modal/_resolver.py index 7dd7cde58..214e17d6d 100644 --- a/modal/_resolver.py +++ b/modal/_resolver.py @@ -127,15 +127,12 @@ async def loader(): raise # Check that the id of functions and classes didn't change - # TODO(erikbern): revisit this once stub assignments have been disallowed - if not obj._is_another_app and (obj.object_id.startswith("fu-") or obj.object_id.startswith("cs-")): - # Persisted refs are ignored because their life cycle is managed independently. - # The same tag on an app can be pointed at different objects. - if existing_object_id is not None and obj.object_id != existing_object_id: - raise Exception( - f"Tried creating an object using existing id {existing_object_id}" - f" but it has id {obj.object_id}" - ) + # Persisted refs are ignored because their life cycle is managed independently. + if not obj._is_another_app and existing_object_id is not None and obj.object_id != existing_object_id: + raise Exception( + f"Tried creating an object using existing id {existing_object_id}" + f" but it has id {obj.object_id}" + ) return obj