dataiku-api-client-python icon indicating copy to clipboard operation
dataiku-api-client-python copied to clipboard

python3 compatibility

Open FChataigner opened this issue 7 years ago • 4 comments

at least iter_rows() on sql_query and dataset fail

FChataigner avatar Jan 26 '18 13:01 FChataigner

I confirm, on a dataikuapi.dss.dataset.DSSDataset object, iter_rows() fails:


Error Traceback (most recent call last) in 2 print(columns) 3 row_count = 0 ----> 4 for row in dataset.iter_rows(): 5 print(row) 6 row_count = row_count + 1

/opt/conda/lib/python3.6/site-packages/dataikuapi/utils.py in iter_rows(self) 83 delimiter='\t', 84 quotechar='"', ---> 85 doublequote=True): 86 yield [none_if_throws(caster)(val) 87 for (caster, val) in dku_zip_longest(casters, uncasted_tuple)]

Error: iterator should return strings, not bytes (did you open the file in text mode?)

Config:

  • dataiku-api-client 4.3.0
  • Python 3.6

victorjourne avatar Feb 07 '19 09:02 victorjourne

@FChataigner, did you install the package with pip? install the latest version of dataikuapi with the setup.py, works now for me!

victorjourne avatar Feb 07 '19 11:02 victorjourne

This was fixed with pull request #33, although it appears it has not reached pypi yet. In the meantime, you can install latest version directly from this repository:

pip install git+https://github.com/dataiku/dataiku-api-client-python@master#egg=dataiku-api-client

bandaangosta avatar Apr 18 '19 13:04 bandaangosta

@bandaangosta, Thank you so much for the solution. It worked for me. However installing the latest version still does not resolve the problem.

ankurc9 avatar Aug 02 '19 11:08 ankurc9