Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clean up assertion in resolver #2057

Merged
merged 1 commit into from
Jul 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions modal/_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading