Conversation
|
Taking by index doesn't work in the case of a custom dash class. Think we can do with a check on the function name, it is |
Co-authored-by: Alex Johnson <johnson.alex.c@gmail.com>
alexcjohnson
left a comment
There was a problem hiding this comment.
💃 This looks good to me!
Note that there's at least one case where this can give a different result from app = Dash(__name__): if you create app in a function that you call from a different module. The inferred root will be the last time you were at the module scope before calling a function. You could construct some very strange situations here - a function imports a module, and that module calls a function that creates the dash app... but it feels to me as though in all those situations you should really be passing in __name__ from the user code anyway, so what you have is the right solution.
Yes I think in those cases you would want to give what is appropriate by either passing the |
Fix
get_caller_nameby always taking the third stack frame from the function call. (0 isget_caller_name,__init__is 1 then next one is theapp = Dash()call)