Skip to content
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

Make pandas optional dependency #6

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

lieryan
Copy link

@lieryan lieryan commented Nov 12, 2018

pandas/numpy can be very slow to import, in some cases it takes multiple seconds to import pandas and it's also a huge library with a huge dependency on numpy, which can be a pain to install if you don't have binary package. This change makes panda an extra dependency so django-csv-exports can automatically use it when it's available, but otherwise use standard library csv module, and to load pandas lazily so it doesn't slow down running unrelated ./manage.py commands when the user has django-csv-exports installed in INSTALLED_APPS.

Lie Ryan added 3 commits November 12, 2018 18:59
Importing pandas/numpy can be slow (it doubles the startup time of
./manage.py, and some people reports that pandas takes seconds to load),
and it's a pretty huge dependency for a functionality that is already in
the standard library. Making it an optional dependency makes it easy for
people to gain pandas speedup while not incurring the cost for those who
don't need it.
This assumes Python 3, but the code is already broken on Python 2 anyway.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant