FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix(automl): fix uploading pandas dataframe to AutoML Tables by helinwang · Pull Request #9647 · googleapis/google-cloud-python · GitHub

fix(automl): fix uploading pandas dataframe to AutoML Tables - #9647

Merged
helinwang merged 1 commit into
googleapis:masterfrom
helinwang:master
Nov 12, 2019
Merged

fix(automl): fix uploading pandas dataframe to AutoML Tables#9647
helinwang merged 1 commit into
googleapis:masterfrom
helinwang:master

Conversation

Copy link
Copy Markdown
Contributor

pandas.dataframe.to_csv() by default exports data index as an column
with empty column name. This causes uploading the export csv file to
fail because AutoML Tables does not allow empty column names. Given
that the data index is not useful for training the model. This PR
fixes the problem by setting the index argument to false so that the
index is not exported.

Fixes #9483

helinwang requested a review from busunkim96 as a code owner November 8, 2019 19:33
googlebot added the cla: yes This human has signed the Contributor License Agreement. label Nov 8, 2019
pandas.dataframe.to_csv() by default exports data index as an column
with empty column name. This causes uploading the export csv file to
fail because AutoML Tables does not allow empty column names. Given
that the data index is not useful for training the model. This PR
fixes the problem by setting the index argument to false so that the
index is not exported.
helinwang changed the title fix(automl): Fix uploading pandas dataframe to AutoML Tables. fix(automl): fix uploading pandas dataframe to AutoML Tables Nov 8, 2019
busunkim96 requested a review from sirtorry November 8, 2019 21:21
tseaver added the api: automl Issues related to the AutoML API. label Nov 11, 2019

tseaver left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks for the patch! @tswast Can you evaluate the correctness here, please?

tswast left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM

It appears the index=False option for to_csv has been in pandas for a long time.

P.S. What's the reason we require 0.24 and above?

"pandas": ["pandas>=0.24.0"],

Copy link
Copy Markdown
Contributor Author

Thanks, @tswast . I am not sure as I just become the maintainer for AutoML Tables' Python SDK.
@TrucHLe @lwander any specific reasons for pandas>=0.24.0?
@tswast do you have any suggestion for pandas' version? If there is no specific reasons for pandas>=0.24.0, I am happy to send a PR to change it.

helinwang merged commit 8fdd2a4 into googleapis:master Nov 12, 2019

tswast commented Nov 12, 2019

Copy link
Copy Markdown
Contributor

If you want to be consistent with BigQuery, we use 0.17.1.

"pandas": ["pandas>=0.17.1"],

Unless you count dropping Python 2 support in 0.25, pandas 0.17 was the version with the most breaking changes in recent history, so something after that will get most customers.

Copy link
Copy Markdown
Contributor Author

Thanks @tswast , sent #9824 to change it to 0.17.1 as well.

parthea pushed a commit that referenced this pull request Oct 21, 2023
pandas.dataframe.to_csv() by default exports data index as an column
with empty column name. This causes uploading the export csv file to
fail because AutoML Tables does not allow empty column names. Given
that the data index is not useful for training the model. This PR
fixes the problem by setting the index argument to false so that the
index is not exported.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: automl Issues related to the AutoML API. cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AutoML: Tables client importing data with 'pandas_dataframe' fails.

4 participants


Back | FazBrowse Home | New Git URL