Skip to content

REF: make indicator_name a cache_readonly #48040

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

Merged
merged 1 commit into from
Aug 12, 2022

Conversation

jbrockmendel
Copy link
Member

Too much going on in __init__ ATM.

@@ -753,6 +744,17 @@ def _maybe_drop_cross_column(
if cross_col is not None:
del result[cross_col]

@cache_readonly
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aside, maybe we can use

from functools import cache (PY3.9)/ lru_cache

@property
@lru_cache(maxsize=None)/@cache
def _indicator_name(...)

in the future instead

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specific to here or replace cache_readonly in general?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To replace cache_readonly in general. Could gain some nice benefits like cache clearing and thread safety (if I'm viewing the implementation correctly)

@mroeschke mroeschke added Refactor Internal refactoring of code Reshaping Concat, Merge/Join, Stack/Unstack, Explode labels Aug 12, 2022
@mroeschke mroeschke added this to the 1.5 milestone Aug 12, 2022
@mroeschke mroeschke merged commit c8fc47b into pandas-dev:main Aug 12, 2022
@mroeschke
Copy link
Member

Thanks @jbrockmendel

@jbrockmendel jbrockmendel deleted the ref-indicator_name branch August 12, 2022 18:35
YYYasin19 pushed a commit to YYYasin19/pandas that referenced this pull request Aug 23, 2022
noatamir pushed a commit to noatamir/pandas that referenced this pull request Nov 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Refactor Internal refactoring of code Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants