innobi / pantab

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

Reading hyper crashes pantab+python (with pantab 5.2.0) #392

Open jwhitaker-gridcog opened 3 hours ago

jwhitaker-gridcog commented 3 hours ago

Describe the bug Reading the attached hyper file makes pantab+python crash with a SIGABRT.

The logs from python include:

terminate called after throwing an instance of 'hyperapi::HyperException'
  what():  The Hyper server closed the connection unexpectedly.
Hint: The server process may have been shut down or terminated before or while processing the request.
Context: 0xfa6b0e2f
Fatal Python error: Aborted

This hyper file was produced by this version of pantab, by passing a pyarrow Table constructed from a pd dataframe. Tableau itself can open the hyper file fine, as can tableauhyperapi==0.0.20027.

To Reproduce Steps to reproduce the behavior:

import pantab
assert pantab.__version__ == '5.2.0'
df = pantab.frame_from_hyper("wind_scenario_comparisons.hyper", table="scenario_comparisons")

Expected behavior

1) no crash :)

2) even given a crash, I'm wondering as a secondary concern if pantab could make this easier to debug - in particular, is there a message in that HyperException that's not being surfaced to Python or stderr?

wind_scenario_comparisons.hyper.gz

System details Linux x86-64 Python 3.12

Edit: this appears to be a new regression in 5.2.0, 5.1.0 works fine.

WillAyd commented 3 hours ago

Thanks for the report. I agree it would be nice to have that error message propagated up. Maybe nanobind had a feature for that?

As to the issue, do you have any way of providing data to reproduce the issue? Ideally if you can provide a self contained code sample it helps with debugging. Thanks!

jwhitaker-gridcog commented 2 hours ago

Did you see the attached hyper?