MachineLearningNotebooks icon indicating copy to clipboard operation
MachineLearningNotebooks copied to clipboard

Dataset.Tabular.register_pandas_dataframe - Error saving date column

Open crisansou opened this issue 5 years ago • 5 comments

Hello,

I used the Dataset.Tabular.register_pandas_dataframe function to save the dataset and it appeared in the log that the data was saved successfully.

image

However, when returning the data from the dataset, the string ERROR appeared in all rows of the date column.

image

Do you know how to solve the problem, please?

Best regards, Cristina


Detalhes do documento

⚠ Não edite esta seção. É necessário para a vinculação do problema do docs.microsoft.com ➟ GitHub.

crisansou avatar Mar 23 '21 14:03 crisansou

Hi, crisansou,

I tried to reproduce your problem but didn't see the failure. Do you mind sharing some information for investigation? Below information will be very helpful:

  • Your subscription Id
  • Your workspace name
  • Your region

Thank you!

YuandaXu avatar Apr 08 '21 01:04 YuandaXu

Hi @YuandaXu ,

Please try this code, if you are unable to reproduce I pass you the requested data. The workspace is in West Europe region:

import pandas as pd import datetime as dt import azureml.core from azureml.core import Workspace, Datastore, Dataset

print("Azure ML Version", azureml.core.VERSION)

Get Workspace

ws = Workspace.from_config()

Get Datastore

datastore = Datastore.get_default(ws)

Generating a dummy dataset

df = pd.util.testing.makeDataFrame() df['data_exec'] = dt.date.today() df.head()

image

try: Dataset.Tabular.register_pandas_dataframe(dataframe = df, target = datastore, name = 'dummy_dataset', description='Dummy Dataset') except Exception as ex: print('Error register_pandas_dataframe: ', ex)

image

image

Best regards, Cristina

Hi, crisansou,

I tried to reproduce your problem but didn't see the failure. Do you mind sharing some information for investigation? Below information will be very helpful:

  • Your subscription Id
  • Your workspace name
  • Your region

Thank you!

crisansou avatar Apr 08 '21 13:04 crisansou

Thanks, Cristina!

I tried your steps and did see the error. Let me confirm with our experts for more details, will back to you soon.

YuandaXu avatar Apr 13 '21 11:04 YuandaXu

Hi, Cristina,

Some updates:

  1. I checked dtypes of dataframe, it turned out the 'data_exec' is datetime.date instead of datetime64, which currently is not supported in data process engine therefore the unsupported values was replaced by string "ERROR" in default.

  2. As a workaround, either a datetime.datetime object or a string would work here, so you can try replace it with either a datetime.datetime or convert it to string. I validated both, they do work.

  3. I also double confirmed supported objects, basically in current stage, we support numpy arrays with datetime64 type, other objects supported would be strings, every other primitive type (numbers, bools) should be stored in numpy arrays specific to that type.

Hopefully above information is helpful.

Thanks!

YuandaXu avatar Apr 15 '21 21:04 YuandaXu

Hi @YuandaXu,

Thanks for the updates! I used datetime64 and string types and it worked in both cases.

image

image

Best regards, Cristina

Hi, Cristina,

Some updates:

  1. I checked dtypes of dataframe, it turned out the 'data_exec' is datetime.date instead of datetime64, which currently is not supported in data process engine therefore the unsupported values was replaced by string "ERROR" in default.
  2. As a workaround, either a datetime.datetime object or a string would work here, so you can try replace it with either a datetime.datetime or convert it to string. I validated both, they do work.
  3. I also double confirmed supported objects, basically in current stage, we support numpy arrays with datetime64 type, other objects supported would be strings, every other primitive type (numbers, bools) should be stored in numpy arrays specific to that type.

Hopefully above information is helpful.

Thanks!

crisansou avatar Apr 15 '21 21:04 crisansou