modal-labs / modal-client

Python client library for Modal
https://modal.com/docs
Apache License 2.0
284 stars 38 forks source link

Add `_is_web_endpoint` attr to `_Function` #2520

Closed devennavani closed 4 days ago

devennavani commented 6 days ago

Describe your changes

Add _is_web_endpoint attr to _Function. The point of _is_web_endpoint is to be able to determine if a _Function is a web function when it is un-hydrated and ._web_url is not populated.

The motivation for this change is that PR 2364 also modifies _add_function to properly populate _App.web_endpoints when called on a new-style class service function that has _method_functions populated. This is necessary because for these new-style classes without method placeholder functions there won't be any invocations of _add_function for the class methods.