-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract _get_op_def_compute_fn into wrap_source_asset_observe_fn_in_o…
…p_compute_fn (Take two) (#16699) ## Summary & Motivation This is another shot at #16618 which was reverted in #16688 after @johannkm discovered a bug. It turns out I had spuriously left a `@staticmethod` decoration on wrap_source_asset_observe_fn_in_op_compute_fn which worked fine both locally and in CI. This because this only worked in Python 3.10 and later. https://docs.python.org/3/whatsnew/3.10.html#other-language-changes ``` Static methods (@staticmethod) and class methods (@classmethod) now inherit the method attributes (__module__, __name__, __qualname__, __doc__, __annotations__) and have a new __wrapped__ attribute. Moreover, static methods are now callable as regular functions. ``` We only run 3.10 in most CI now for cost control. However, sometimes we pay the iron price for this optimization. ## How I Tested These Changes Load original PR locally in python 3.9. Confirm error on original PR. Apply this patch. See no error.
- Loading branch information
Showing
1 changed file
with
75 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters