0

I need to read the tables from click house via Python Azure function, I am able to read the tables from my local system but not able to read from Python Azure Function.

What I tried:

import clickhouse_connect
client = clickhouse_connect.get_client(host=host, port=port, username='XXXX', password='XXXX', database = 'MYDB')
df = client.query_df('SELECT TOP (10) * FROM MYTABLE')
print(df)

The above is working from my local system, but when I am running the same code from azure function then I am getting the following error

import clickhouse_connect
client = clickhouse_connect.get_client(host=host, port=port, username='XXXX', password='XXXX', database = 'MYDB')
df = client.query_df('SELECT TOP (10) * FROM MYTABLE') <-- Error 'NoneType' object has no attribute 'array'

1 Answers1

0

You need to check if you have generated the requirements.txt which includes all of the information of the modules (in your case, clickhouse-connect 0.6.6). When you deploy the function to azure, it will install the modules by the requirements.txt automatically.

techkuz
  • 3,608
  • 5
  • 34
  • 62