Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Unsupported column type: <class 'numpy.ndarray'>. list or tuple is expected. #356

Open
FedericoCeratto opened this issue Feb 2, 2023 · 2 comments

Comments

@FedericoCeratto
Copy link
Contributor

Hello and thanks for developing the library.
I'm able to reproduce #318 with version 0.2.5 with a minimal example:

CREATE TABLE mytest (                                                           
`status` String                                                                 
)                                                                               
ENGINE = ReplacingMergeTree                                                     
ORDER BY (status)                                                               
SETTINGS index_granularity = 4                                                  
df = pd.DataFrame(columns=["status"])                                           
click.insert_dataframe("INSERT INTO mytest VALUES", df)

A more clear error message would be useful.

@ktncktnc
Copy link

ktncktnc commented Feb 3, 2023

I also faced it. No idea what did this message mean.

@xzkostyan
Copy link
Member

Client can write and read using:

  • usual columns/rows: in lists or tuples
  • numpy arrays or pandas dataframes.

In the first case pure client is created without settings={'use_numpy': True} and data for insertion must be provided in lists or tuples.
In the second case numpy client is created with settings={'use_numpy': True} and data for insertion must be provided in numpy arrays of pandas dataframe.

We can make error more clear if we will raise an exception when user calls insert_dataframe/query_dataframe with pure client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants