fix(automl): fix uploading pandas dataframe to AutoML Tables#9647
Merged
helinwang merged 1 commit intogoogleapis:masterfrom Nov 12, 2019
Merged
fix(automl): fix uploading pandas dataframe to AutoML Tables#9647helinwang merged 1 commit intogoogleapis:masterfrom
helinwang merged 1 commit intogoogleapis:masterfrom
Conversation
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.
tswast
approved these changes
Nov 12, 2019
Contributor
tswast
left a comment
There was a problem hiding this comment.
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?
google-cloud-python/automl/setup.py
Line 29 in 5cbfa26
Contributor
Author
Contributor
|
If you want to be consistent with BigQuery, we use google-cloud-python/bigquery/setup.py Line 44 in cab728b 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. |
Contributor
Author
This was referenced Jan 29, 2020
[CHANGE ME] Re-generated container to pick up changes in the API or client library generator.
#10256
Closed
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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