Unable to get dremio-client to work locally

I have already installed dremio-client and confuse.
This is my test3_dremio.py file:
import json

import requests

from dremio_client.flight import query

username = ‘userid’

password = ‘MyPQD’

headers = {‘content-type’:‘application/json’}

dremioServer = ‘https://localhost.com

portno=31480

query =“select * from sys.options”

output = dremio_client.flight.query(sql =query, hostname=dremioServer, port=portno, username=username, password=password)

print(output)

Error:
Traceback (most recent call last):
File “test3_dremio.py”, line 13, in
output = dremio_client.flight.query(sql =query, hostname=dremioServer, port=portno, username=username, password=password)
NameError: name ‘dremio_client’ is not defined

Hello @Shirisha,

I think you are re-using some variable name that you should not be. Try:
import requests

from dremio_client.flight import query

username = ‘userid’

password = ‘MyPQD’

headers = {‘content-type’:‘application/json’}

dremioServer = ‘https://localhost.com'

portno=31480

my_query =“select * from sys.options”

output = query(sql=my_query, hostname=dremioServer, port=portno, username=username, password=password)

print(output)

Ben, Thank you for prompt response. I am still unable to get it to work. I do have pyarrow 2.0.0 but somehow it is not liking it. File “C:\Users\nz6sx6\Miniconda3\envs\dremio\lib\site-packages\dremio_client\flight_init_.py”, line 106, in query
raise NotImplementedError(“Python Flight bindings require Python 3 and pyarrow > 0.14.0”)
NotImplementedError: Python Flight bindings require Python 3 and pyarrow > 0.14.0

(dremio) D:\dremio\base_python>conda list pyarrow

packages in environment at C:\Users\nz6sx6\Miniconda3\envs\dremio:

Name Version Build Channel

pyarrow 2.0.0 pypi_0 pypi

(dremio) D:\dremio\base_python>conda list python

packages in environment at C:\Users\nz6sx6\Miniconda3\envs\dremio:

Name Version Build Channel

python 3.9.1 h6244533_2
python-dateutil 2.8.1 pyhd3eb1b0_0
python_abi 3.9 1_cp39 conda-forge

I fixed my environment after which it worked

Is there any sample code to create VDS?

say I want to create CREATE OR REPLACE VDS test.test1 as select * from datasourcename.table1

what are catalog and path in this case? I am assuming sqlContext is null
dremio_client.model.data.create_vds(catalog, path, sql, sqlContext)

Appreciate your response

What did you need to do to fix your environment?