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
If there is already a relevant issue, whether open or closed, comment on the existing thread instead of posting a new issue.
Description
In the documentation is stated
file
The name of the file to save the image to. Accepts names ending with .png, .bmp, and other
image extensions. Also accepts the extension .pdf.
but actually right now any format that will be insterted when saving the table to file will be replaced by .png extension. This is probably related to #499 which edited these lines:
with the problem that .with_suffix always put the desired extension.
I can also create a PR. It seems a pretty straightforward fix, but I'd like to have a confirmation about this bug, thanks.
Reproducible example
fromgreat_tablesimportGTfromgreat_tables.dataimportsp500# Define the start and end dates for the data rangestart_date="2010-06-07"end_date="2010-06-14"# Filter sp500 using Pandas to dates between `start_date` and `end_date`sp500_mini=sp500[(sp500["date"] >=start_date) & (sp500["date"] <=end_date)]
# Create a gt table based on the `sp500_mini` table datatable= (
GT(sp500_mini)
.tab_header(title="S&P 500", subtitle=f"{start_date} to {end_date}")
.fmt_currency(columns=["open", "high", "low", "close"])
.fmt_date(columns="date", date_style="wd_m_day_year")
.fmt_number(columns="volume", compact=True)
.cols_hide(columns="adj_close")
)
table.save("sp500_mini.pdf")
You'll see a file sp500_mini.png
Expected result
It should have saved a file named sp500_mini.pdf
Development environment
Operating System: Linux, Ubuntu 24.04
great_tables Version: 0.16.1
The text was updated successfully, but these errors were encountered:
@machow and @rich-iannone, could you help address these issues? GT.save() is a crucial function in our library. (Apologies for the potential bugs—I'm currently on Chinese New Year holiday and may have limited access to a computer.)
0x64746b
added a commit
to 0x64746b/x332-target-speeds
that referenced
this issue
Jan 31, 2025
Prework
Description
In the documentation is stated
but actually right now any format that will be insterted when saving the table to file will be replaced by
.png
extension. This is probably related to #499 which edited these lines:with the problem that
.with_suffix
always put the desired extension.I can also create a PR. It seems a pretty straightforward fix, but I'd like to have a confirmation about this bug, thanks.
Reproducible example
You'll see a file
sp500_mini.png
Expected result
It should have saved a file named
sp500_mini.pdf
Development environment
The text was updated successfully, but these errors were encountered: