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
Lazy-load pandas and pyarrow to improve performance #8125
Conversation
_PILLOW_RE: Final = re.compile(r"^PIL\..*") | ||
|
||
|
||
def is_pillow_image(obj: object) -> bool: |
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.
@LukasMasuch do we need this function as part of this PR?
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.
Ahh, good catch. Not really, for this specific PR. But for another lazy-loading PR.
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.
Will merge with this method for now, since I anyways will wrap up the other PR that needs it today. And it our CI doesn't work right now I would do another commit.
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.
## Describe your changes Lazy-load `pandas` and `pyarrow` only when required (e.g. usage of `st.dataframe`). This PR also includes a couple of other small refactorings related to typing and imports. ## GitHub Issue Link (if applicable) Related to streamlit#6066 ## Testing Plan - Added e2e test to ensure that `pyarrow` and `pandas` are lazy-loaded. --- **Contribution License Agreement** By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.
Describe your changes
Lazy-load
pandas
andpyarrow
only when required (e.g. usage ofst.dataframe
).This PR also includes a couple of other small refactorings related to typing and imports.
GitHub Issue Link (if applicable)
Related to #6066
Testing Plan
pyarrow
andpandas
are lazy-loaded.Contribution License Agreement
By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.