Skip to content

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

@jhoh10

Description

@jhoh10

Problem:

Client: automl_v1beta1
Class: TablesClient
Method: import_data

When using pandas_dataframe argument when specifying data to import to automl tables, get:
"google.api_core.exceptions.GoogleAPICallError: None Invalid column names: " error. I believe

Environment details:

os: windows
python version: 3.5
google-cloud-automl==0.7.0
google==2.0.2
google-api-core==1.14.3

Code Example:

import pandas as pd
from google.cloud import automl_v1beta1

client = automl_v1beta1.TablesClient(project=<my_project>, region=<my_region>)
d = client.create_dataset(dataset_display_name=<ds_display_name)
data_df = pd.DataFrame({'a':[1,2,3], 'b':[4,5,6]})
response = client.import_data(dataset=d, pandas_dataframe=data_df)

def callback(operation_future):
    result = operation_future.result()
response.add_done_callback(callback)

Stack trace

Error while executing Future callback. Traceback (most recent call last): File "/home/jupyter/.local/lib/python3.5/site-packages/google/api_core/future/_helpers.py", line 37, in safe_invoke_callback return callback(*args, **kwargs) File "<ipython-input-41-d646f4ce2c0e>", line 6, in callback result = operation_future.result() File "/home/jupyter/.local/lib/python3.5/site-packages/google/api_core/future/polling.py", line 127, in result raise self._exception google.api_core.exceptions.GoogleAPICallError: None Invalid column names:

hypothesis:

it seems to be treating the dataframe index as a column in the import, and if this is not specified, will trigger the invalid column name error. If I set the index to one of the columns, it works.
Suggest leaving index out of import by default, and maybe optionally include index during import with keyword argument.

Metadata

Metadata

Assignees

Labels

priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions