Ardhana
Ardhana

Reputation: 1

Reading Data Frame in Atoti?

While reading Dataframe in Atoti using the following code error is occured which is shown below.

#Code global_data=session.read_pandas(df,keys=["Row ID"],table_name="Global_Superstore")

#error

ArrowInvalid: Could not convert '2531' with type str: tried to convert to int64

How to solve this? Please help guys..

Was trying to read a Dataframe using atoti functions.

Upvotes: 0

Views: 294

Answers (1)

Ben Herro
Ben Herro

Reputation: 16

There are values with different types in that particular column. If you aren't going to preprocess the data and you're fine with that column being read as a string, then you should specify the exact datatypes of each of your columns (or that particular column), either when you load the dataframe with pandas, or when you read the data into a table with the function you're currently using:

import atoti as tt

global_superstore = session.read_pandas(
    df, 
    keys=["Row ID"],
    table_name="Global_Superstore",
    types={
        "<invalid_column>": tt.type.STRING
    }
)

Upvotes: 0

Related Questions