Describe the bug
See import time when installing openai[datalib] due to pandas load time.
To Reproduce
Install openai and compare import time with and without [datalib] extension installed (pandas).
Code snippets
In local 4s
import time
t1 = time.perf_counter()
from openai.datalib import pandas_helper
print(time.perf_counter() - t1, pandas_helper.pandas)
t1 = time.perf_counter()
try:
pandas_helper.assert_has_pandas()
except pandas_helper.MissingDependencyError:
pass
print(time.perf_counter() - t1, pandas_helper.pandas)
t1 = time.perf_counter()
try:
pandas_helper.assert_has_pandas()
except pandas_helper.MissingDependencyError:
pass
print(time.perf_counter() - t1, pandas_helper.pandas)
4.230538249947131 <module 'pandas' from '/Users/pedrovicente/.virtualenvs/openai-python-uihn/lib/python3.10/site-packages/pandas/__init__.py'>
6.669433787465096e-07 <module 'pandas' from '/Users/pedrovicente/.virtualenvs/openai-python-uihn/lib/python3.10/site-packages/pandas/__init__.py'>
2.919696271419525e-07 <module 'pandas' from '/Users/pedrovicente/.virtualenvs/openai-python-uihn/lib/python3.10/site-packages/pandas/__init__.py'>
OS
Linux
Python version
python 3.10
Library version
openai-python v0.27.2
Describe the bug
See import time when installing openai[datalib] due to pandas load time.
To Reproduce
Install openai and compare import time with and without [datalib] extension installed (pandas).
Code snippets
OS
Linux
Python version
python 3.10
Library version
openai-python v0.27.2