Issue by elijahbenizzy
Thursday Jan 12, 2023 at 00:35 GMT
Originally opened as stitchfix/hamilton#272
inspect.getmodule(fn) depends on the state of sys.modules. This can break if you're doing repeated parsing -- E.G. running it then wiping sys.modules. Instead, we can just ask the function for its module. It's simpler, and won't break.
[Short description explaining the high-level reason for the pull request]
Changes
How I tested this
Notes
Checklist
elijahbenizzy included the following code: https://github.com/stitchfix/hamilton/pull/272/commits
Thursday Jan 12, 2023 at 00:35 GMT
Originally opened as stitchfix/hamilton#272
inspect.getmodule(fn) depends on the state of sys.modules. This can break if you're doing repeated parsing -- E.G. running it then wiping sys.modules. Instead, we can just ask the function for its module. It's simpler, and won't break.
[Short description explaining the high-level reason for the pull request]
Changes
How I tested this
Notes
Checklist
elijahbenizzy included the following code: https://github.com/stitchfix/hamilton/pull/272/commits