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

D2G uploading dataframe with ' attached to it in values #53

Open
monipip3 opened this issue Jun 10, 2020 · 7 comments
Open

D2G uploading dataframe with ' attached to it in values #53

monipip3 opened this issue Jun 10, 2020 · 7 comments

Comments

@monipip3
Copy link

When uploading dataframe into a google sheets each value appends a '

And when I search for this object ' to replace in Google sheets, Google sheet cant find / recognize it.

@monipip3
Copy link
Author

Screen Shot 2020-06-10 at 11 03 10 AM

@TheCalcifer
Copy link

Hi, same problem, any news please ?

@fkuri-meli
Copy link

if they could add the parameter of value_input_option to the upload function like this wks.update_cells(cell_list, value_input_option='USER_ENTERED') it would be great! See: https://stackoverflow.com/questions/63273092/problem-with-data-format-while-importing-pandas-df-from-python-into-google-sheet

@richbon75
Copy link

Now that the fix has been merged into the repo, is this going to get released? The latest version on PyPi is still 1.0.4, which doesn't have this fix in it. (And this is a pretty important fix.)

@sugiyama34
Copy link

I think this problem hasn't been solved.
Is there any progress..?

@mroy-seedbox
Copy link

mroy-seedbox commented Jun 13, 2022

I'd suggest abandoning df2gspread (that's what we did), when an entire library can be replaced with a couple lines of monkey patching in the actively maintained gspread lib:

    def upload_pandas_df(self, df):
      values = [df.columns.values.tolist()]
      values.extend(df.values.tolist())
      sheet.values_update(
        self.title,
        params = { 'valueInputOption': 'USER_ENTERED' },
        body = { 'values': values }
      )

    gspread.Worksheet.upload_pandas_df = upload_pandas_df

Or use gspread-dataframe instead.

@TrevorMcGuireNG
Copy link

Solution: on line 147 of df2gspread.py, wks.update_cells(cell_list) has a default setting value_input_option=ValueInputOption.raw, but it should be value_input_option=ValueInputOption.user_entered instead.

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

No branches or pull requests

7 participants