-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
REF: Remove side effects from importing Styler 2 #53429
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -1840,7 +1874,10 @@ def _maybe_wrap_formatter( | |||
|
|||
# Replace chars if escaping | |||
if escape is not None: | |||
func_1 = lambda x: func_0(_str_escape(x, escape=escape)) | |||
markupsafe = import_optional_dependency( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this might be quite an expensive import operation if the formatter is applied over each cell. Will have to check this
@rhshadrach I created this versus your original PR, to remove some of the floating class attribute caches. One or two things to clean up test wise but I think it preserves almost all functionality whilst achieving the import side effects changes. |
Sounds good! |
This pull request is stale because it has been open for thirty days with no activity. Please update and respond to this comment if you're still interested in working on this. |
Are you still working on this @attack68? |
I looked at this yesterday coincidentally actually. Last I checked this works locally but I couldnt get the tests to pass online because they read a file and I guess there is something wrong with the paths. This was quite a good PR though just havent had time to push it over the edge. |
Closing to clear the queue, but when you have time to come back to this feel free to reopen the PR |
draft
Alongside this PR I would also recommend:
Styler.from_custom_template
since it will be more featureful to create a class directly with specified new templates, and basically just as easy. Docs could be updated.