villebro commented on a change in pull request #16889:
URL: https://github.com/apache/superset/pull/16889#discussion_r718525851



##########
File path: superset/utils/memoized.py
##########
@@ -64,7 +64,9 @@ def __get__(
         if not self.is_method:
             self.is_method = True
         # Support instance methods.
-        return functools.partial(self.__call__, obj)
+        func = functools.partial(self.__call__, obj)
+        func.__func__ = self.func  # type: ignore
+        return func

Review comment:
       I wasn't quite able to figure out why this is necessary, but running 
doctests on memoized methods started failing on 3.9 due to the doctests failing 
to find the `__func__` attribute on memoized methods. The only thing I found is 
this which seems like the same problem, but is said to affect Python 3.8, not 
3.9: https://bugs.python.org/issue12790 Hacky workaround, but does the trick. 
I'll try to figure out how to solve this more elegantly before this gets merged




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to