Skip to content

Add option to import all columns as unformated / formula #56

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions gspread_pandas/spread.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,10 +373,10 @@ def sheet_to_df(
row number for first row of headers or data (default 1)
unformatted_columns : list
column numbers or names for columns you'd like to pull in as
unformatted values (defaul [])
unformatted values, use -1 for all columns (default None)
formula_columns : list
column numbers or names for columns you'd like to pull in as
actual formulas (defaul [])
actual formulas, use -1 for all columns (default None)
sheet : str,int
optional, if you want to open a different sheet first,
see :meth:`open_sheet <gspread_pandas.spread.Spread.open_sheet>`
Expand Down Expand Up @@ -405,6 +405,8 @@ def sheet_to_df(
# replace values with a different value render option before we set the
# index in set_col_names
if unformatted_columns:
if unformatted_columns[0] == -1:
unformatted_columns = col_names
self._fix_value_render(
df,
header_rows + start_row - 1,
Expand All @@ -414,6 +416,8 @@ def sheet_to_df(
)

if formula_columns:
if formula_columns[0] == -1:
formula_columns = col_names
self._fix_value_render(
df, header_rows + start_row - 1, col_names, formula_columns, "FORMULA"
)
Expand Down