Skip to content

Add context manager to enable/disable patching#48

Open
rjzamora wants to merge 1 commit intorapidsai:branch-24.06from
rjzamora:toggle-patching
Open

Add context manager to enable/disable patching#48
rjzamora wants to merge 1 commit intorapidsai:branch-24.06from
rjzamora:toggle-patching

Conversation

@rjzamora
Copy link
Member

Motivated by @vyasr 's suggestion in #46

Adds a simple context/utility to toggle patching behavior. This should make it easier to quickly test if patching is causing a hypothetical bug in the future.

@rjzamora rjzamora added improvement Improves an existing functionality non-breaking Introduces a non-breaking change labels May 22, 2024
@rjzamora rjzamora self-assigned this May 22, 2024
@rjzamora rjzamora requested review from a team and vyasr as code owners May 22, 2024 19:20
Copy link
Member

@pentschev pentschev left a comment

Choose a reason for hiding this comment

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

I like the idea and it generally looks good to me. However, I don't feel experienced enough with the patching mechanism and would prefer to have @vyasr reviewing.

Thanks @rjzamora for working on this, I can see this being very useful for debugging issues in the future. 🙂

Copy link
Contributor

@vyasr vyasr left a comment

Choose a reason for hiding this comment

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

Instead of rewriting the environment each time in the CM, can we load it once at the module level and store it in a module-scope var that is overwritten temporarily in the CM? Modifying the environment each time feels pretty heavyweight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Improves an existing functionality non-breaking Introduces a non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants