innobi / pantab

Read/Write pandas DataFrames with Tableau Hyper Extracts
BSD 3-Clause "New" or "Revised" License
114 stars 44 forks source link

pantab is incompatible with the version of Tableau Hyper API installed on your system #145

Closed cmcrae13 closed 2 years ago

cmcrae13 commented 2 years ago

Unsure how to proceed...

Pantab install Requirement already satisfied: pantab in /usr/local/lib/python3.7/dist-packages (2.1.0) Requirement already satisfied: tableauhyperapi in /usr/local/lib/python3.7/dist-packages (from pantab) (0.0.14567) Requirement already satisfied: pandas in /usr/local/lib/python3.7/dist-packages (from pantab) (1.3.5) Requirement already satisfied: numpy in /usr/local/lib/python3.7/dist-packages (from pantab) (1.21.5) Requirement already satisfied: python-dateutil>=2.7.3 in /usr/local/lib/python3.7/dist-packages (from pandas->pantab) (2.8.2) Requirement already satisfied: pytz>=2017.3 in /usr/local/lib/python3.7/dist-packages (from pandas->pantab) (2018.9) Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.7/dist-packages (from python-dateutil>=2.7.3->pandas->pantab) (1.15.0) Requirement already satisfied: cffi!=1.14.3,<2,>=1.12.2 in /usr/local/lib/python3.7/dist-packages (from tableauhyperapi->pantab) (1.15.0) Requirement already satisfied: pycparser in /usr/local/lib/python3.7/dist-packages (from cffi!=1.14.3,<2,>=1.12.2->tableauhyperapi->pantab) (2.21)


NotImplementedError Traceback (most recent call last) in () ----> 1 import pantab

2 frames /usr/local/lib/python3.7/dist-packages/pantab/init.py in _check_compatibility(check, message) 46 def _check_compatibility(check, message): 47 if not check: ---> 48 raise NotImplementedError(message + "\n" + api_incompatibility_msg) 49 50

NotImplementedError: expected 'hyper_rowset_chunk_field_values' to have the signature 'struct hyper_error_t ()(struct hyper_rowset_chunk_t , size_t , size_t , uint8_t , size_t , int8_t )', got 'void()(struct hyper_rowset_chunk_t , size_t , size_t , uint8_t , size_t *)'

pantab is incompatible with the version of Tableau Hyper API installed on your system. Please upgrade both tableauhyperapi and pantab to the latest version. If doing so does not fix this issue, please file an issue at https://github.com/innobi/pantab/issues mentioning the exact pantab and HyperAPI versions which triggered this error.

WillAyd commented 2 years ago

Does downgrading to an older version of the hyper api work? The version you have looks to have just been released today with some C-API breaking changes. Will need a PR to support that

@vogelsgesang

vogelsgesang commented 2 years ago

Indeed, the interface of hyper_rowset_chunk_field_values changed with the latest HyperAPI release. Downgrading should fix this, until a solution in pantab is available. Good that we put a detection mechanism for that into pantab :)

vogelsgesang commented 2 years ago

From Hyper's internal git log:

The commit [i.e., the change which broke this] also removes the redundant nullValues array from the hyper_rowset_chunk_field_values interface. The values are now simply nullptrs if they are null. Also, the hyper_rowset_chunk_field_values interface is now noexcept since it no longer allocates any memory.

So the check here can now be simplified quite nicely. Wouldn't be surprised if this also gives a nice performance boost to pantab.

We (i.e.: Tableau Hyper team) will see how we find time to contribute a fix for this. Expect to hear something within the next week(s). If somebody else finds time to fix this earlier, please go ahead. Happy to provide any advice/guidance/code reviews. In the meantime, your best option is to pin Hyper API at version 0.0.14401

Btibert3 commented 2 years ago

Also just noticed this throwing install errors when using Google Colab, but pinning version to 0.0.14401 did the trick in the short run.

rachwng commented 2 years ago

Hi,

pip install --force-reinstall tableauhyperapi==0.0.14401 --user Collecting tableauhyperapi==0.0.14401 Using cached tableauhyperapi-0.0.14401-py3-none-win_amd64.whl (34.4 MB) Collecting cffi!=1.14.3,<2,>=1.12.2 Using cached cffi-1.15.0-cp39-cp39-win_amd64.whl (180 kB) Collecting pycparser Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB) Installing collected packages: pycparser, cffi, tableauhyperapi Successfully installed cffi-1.15.0 pycparser-2.21 tableauhyperapi-0.0.14401

But running import pantab:


NotImplementedError Traceback (most recent call last) ~\AppData\Local\Temp/ipykernel_8824/1171623716.py in 9 import os,glob,re,sys 10 pd.options.mode.chained_assignment=None ---> 11 import pantab 12 from openpyxl import load_workbook 13 from openpyxl.worksheet.datavalidation import DataValidation

~\anaconda3\lib\site-packages\pantab__init__.py in 107 "hyper_destroy_rowset_chunk", "void()(struct hyper_rowset_chunk_t )" 108 ), --> 109 _get_hapi_function( 110 "hyper_rowset_chunk_field_values", 111 "struct hyper_error_t ()(struct hyper_rowset_chunk_t , size_t , size_t , uint8_t , size_t , int8_t )",

~\anaconda3\lib\site-packages\pantab__init__.py in _get_hapi_function(name, sig) 56 f"expected '{name}' to be a function, got {func_type.kind}", 57 ) ---> 58 _check_compatibility( 59 func_type.cname == sig, 60 f"expected '{name}' to have the signature '{sig}', got '{func_type.cname}'",

~\anaconda3\lib\site-packages\pantab__init__.py in _check_compatibility(check, message) 45 def _check_compatibility(check, message): 46 if not check: ---> 47 raise NotImplementedError(message + "\n" + api_incompatibility_msg) 48 49

NotImplementedError: expected 'hyper_rowset_chunk_field_values' to have the signature 'struct hyper_error_t ()(struct hyper_rowset_chunk_t , size_t , size_t , uint8_t , size_t , int8_t )', got 'void()(struct hyper_rowset_chunk_t , size_t , size_t , uint8_t , size_t *)'

pantab is incompatible with the version of Tableau Hyper API installed on your system. Please upgrade both tableauhyperapi and pantab to the latest version. If doing so does not fix this issue, please file an issue at https://github.com/innobi/pantab/issues mentioning the exact pantab and HyperAPI versions which triggered this error.


Still facing the same issue. Please help!

vogelsgesang commented 2 years ago

@rachwng It seems like your downgrade did not take effect as intended. I don't know anaconda, and don't know what could have gone wrong, but the error message raised by pantab still indicates that you are on a newer version of HyperAPI

SarahBeth026 commented 2 years ago

I'm getting this error also, but slightly different

image

I have pantab v2.1.0 and tableauhyperapi v0.0.14751. I tried running pip install --force-reinstall tableauhyperapi==0.0.14401 --user and confirmed that it was using that version by running pip show tableauhyperapi| grep Version, but I'm still getting the same error. Any other ideas?

WillAyd commented 2 years ago

@SarahBeth026 are you sure the environment you are running pantab from is the same as the one with the tableauhyperapi you force reinstalled? Based off of what you’ve described I think those might be getting mixed up

Carole-R commented 2 years ago

Hello @WillAyd I've read your discussion under @vogelsgesang 's pull request and I would like to understand when the merger will take place? This would be greatly appreciated so that pantab runs smoothly for new users (i.e. working with the latest HyperAPI release).

WillAyd commented 2 years ago

@Carole-R looks like there are merge issues and outstanding comments on that PR. Is that something you would like to take over?

Carole-R commented 2 years ago

@WillAyd I'm a Python beginner for now. If @vogelsgesang wasn't able to go through the update, I don't think I'll be able to do better. I'll stick to pinning Hyper API at version 0.0.14401. Let's hope it won't slow new users from using Pantab (which is a very useful tool imo).