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

Improve the error message for unhydrated objects #1778

Merged
merged 6 commits into from
May 1, 2024

Conversation

mwaskom
Copy link
Contributor

@mwaskom mwaskom commented Apr 30, 2024

This is a persistent source of confusion. I am pretty sure that the main cause of this error (these days at least) is when users try to do func.remote() or similar in a "bare" Python script, or when they have multiple apps and are running a different one. I am fairly certain that we now catch "not in global scope" at function wrapping time, and storage objects can now be lazily hydrated.

I also don't think that mentioning "lazily hydrated" is helpful since that's an implementation detail and not something a user can understand or act on.

It might be helpful to add some Function-specific logic to include the function name in the error message, but I wasn't sure what the best way to approach that was, so I went for a smaller improvement.

Copy link

@modal-pr-review-automation modal-pr-review-automation bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto-approved 👍. This diff qualified for automatic approval and doesn't need follow up review.

@erikbern
Copy link
Contributor

def seems like an upgrade so 👍

i think we could probably infer from the environment what's going on even more dynamically. e.g. if it's a function on a non-running app, we could say that.

@mwaskom
Copy link
Contributor Author

mwaskom commented May 1, 2024

OK, a little sketchy, but I added some logic to try and get the function name and whether the app is running in some places. Not totally obvious how to do that so could maybe be improved further.

@mwaskom mwaskom merged commit e76aa12 into main May 1, 2024
22 checks passed
@mwaskom mwaskom deleted the michael/improve-hydration-error branch May 1, 2024 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants