-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
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.