Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicit errors message when arrow version mismatch #80

Merged
merged 4 commits into from
Feb 5, 2025

Conversation

marcin-krystianc
Copy link
Contributor

@marcin-krystianc marcin-krystianc commented Jan 29, 2025

Improving exception message when PalletJack fails to import arrow libraries.
We generate a Python file with package metadata at build time so it works independently of how the package is installed.

  • Before:
Traceback (most recent call last):
  File "/workspace/PalletJack/python/test/test_palletjack.py", line 4, in <module>
    import palletjack as pj
  File "/workspace/PalletJack/python/palletjack/__init__.py", line 3, in <module>
    from .palletjack_cython import *
ImportError: libarrow.so.1900: cannot open shared object file: No such file or directory
  • After:
Traceback (most recent call last):
  File "/workspace/PalletJack/python/test/test_palletjack.py", line 4, in <module>
    import palletjack as pj
  File "/workspace/PalletJack/python/palletjack/__init__.py", line 13, in <module>
    raise ImportError(f"This version of {__package__}={__version__} is built against {pyarrow_req}, please ensure you have it installed. Current pyarrow version is {pyarrow.__version__}. ({str(e)})") from None
ImportError: This version of palletjack=2.5.0 is built against pyarrow~=19.0.0, please ensure you have it installed. Current pyarrow version is 18.0.0. (libarrow.so.1900: cannot open shared object file: No such file or directory)

@marcin-krystianc marcin-krystianc marked this pull request as draft January 30, 2025 11:45
@marcin-krystianc marcin-krystianc marked this pull request as ready for review February 4, 2025 10:45
@marcin-krystianc marcin-krystianc merged commit eee04d3 into master Feb 5, 2025
18 checks passed
@marcin-krystianc marcin-krystianc deleted the dev-20250129-libversion branch February 5, 2025 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants