Skip to content

Conversation

@teddygood
Copy link
Contributor

@teddygood teddygood commented Nov 8, 2025

Fixes #58240, Related to #57664

Ensure Serve wrapper classes preserve original class metadata. Wrappers now copy __qualname__, __module__, __doc__, __annotations__, and __wrapped__ in addition to __name__. Added tests to verify metadata preservation for task_consumer and ingress decorators.

@teddygood teddygood requested a review from a team as a code owner November 8, 2025 20:55
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This is a solid pull request that correctly addresses the issue of preserving metadata on wrapper classes in Ray Serve. The introduction of the copy_class_metadata utility function is a clean way to centralize this logic, and its application in the ingress and task_consumer decorators is appropriate. The new tests are well-written and provide good coverage for the added functionality, ensuring that attributes like __name__, __qualname__, __module__, __doc__, and __annotations__ are correctly propagated. The changes improve the introspection capabilities of Serve deployments and are a welcome enhancement.

@teddygood teddygood changed the title [serve] Preserve deployment metadata on wrapper classes [Serve] Preserve deployment metadata on wrapper classes Nov 8, 2025
@ray-gardener ray-gardener bot added serve Ray Serve Related Issue community-contribution Contributed by the community labels Nov 9, 2025
@teddygood
Copy link
Contributor Author

Hi @abrarsheikh
I opened this PR that updates Ray Serve to preserve deployment metadata on wrapper classes.
If you have a moment, could you please take a look or point me to the appropriate reviewer?
Thanks in advance for your time.

@harshit-anyscale harshit-anyscale added the go add ONLY when ready to merge, run all tests label Dec 3, 2025
@abrarsheikh abrarsheikh merged commit 6912b69 into ray-project:master Dec 9, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-contribution Contributed by the community go add ONLY when ready to merge, run all tests serve Ray Serve Related Issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[serve] Wrapper classes may obscure original Deployment metadata (e.g. __name__)

3 participants