You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since to_excel does currently not support writing to file objects it cannot support gs://. The two engines (openpyxl and xlsxwriter) that actually write the excel file also seem to want a file path and no file object.
Pandas would probably need to create a temporary file (I'm not sure whether pandas wants that), let the two engines write to it, read the content, and then write it to a file object to support gs://.
It is probably easier if the user calls to_excel with a local filename, reads the content, and then sends it to GCloud Storage.
edit: the excel backends seem to support file handles, so it should be possible to add support for google cloud storage.
Code Sample, a copy-pastable example
Problem description
I want to write the DF as a
.parquet
and a.xlsx
file to a GCloud Storage bucket.I launch the job in a K8S pod and I finally got the error message :
Next I change the
to_excel
->to_csv
and everything works as expected.Do the
to_excel
can handle a path asgs://...
? Because it's the only issue I can see with that.Output of
pd.show_versions()
INSTALLED VERSIONS
commit : None
python : 3.7.7.final.0
python-bits : 64
OS : Linux
OS-release : 4.14.138+
machine : x86_64
processor :
byteorder : little
LC_ALL : C.UTF-8
LANG : C.UTF-8
LOCALE : en_US.UTF-8
pandas : 1.0.3
numpy : 1.18.1
pytz : 2020.1
dateutil : 2.8.1
pip : 20.0.2
setuptools : 46.1.3.post20200330
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : None
IPython : None
pandas_datareader: None
bs4 : None
bottleneck : None
fastparquet : None
gcsfs : 0.6.1
lxml.etree : None
matplotlib : None
numexpr : None
odfpy : None
openpyxl : 3.0.3
pandas_gbq : None
pyarrow : 0.15.1
pytables : None
pytest : None
pyxlsb : None
s3fs : None
scipy : 1.4.1
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlwt : 1.3.0
xlsxwriter : None
numba : None
The text was updated successfully, but these errors were encountered: