-
Notifications
You must be signed in to change notification settings - Fork 722
feat: make pyarrow hot fix optional #11977
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,6 +33,7 @@ | |
| ) | ||
| from ibis.backends.sql import SQLBackend | ||
| from ibis.backends.sql.compilers.base import STAR, AlterTable, C, RenameTable | ||
| from ibis.common import import_to_try_pyarrow_hotfix # noqa: F401 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This got moved up here to the top level. So now as soon as you import this file, you need pyarrow installed. I'm guessing you did this to reduce the number of imports from 3 to 1, which is a nice simplification. But I think we should remain more conservative, and only The one exception is I don't think we need to |
||
| from ibis.common.dispatch import lazy_singledispatch | ||
| from ibis.expr.operations.udf import InputType | ||
|
|
||
|
|
@@ -42,7 +43,6 @@ | |
| import pandas as pd | ||
| import polars as pl | ||
| import pyarrow as pa | ||
| import pyarrow_hotfix # noqa: F401 | ||
| import torch | ||
| from fsspec import AbstractFileSystem | ||
|
|
||
|
|
@@ -1380,7 +1380,6 @@ def to_pyarrow_batches( | |
| The number of rows to fetch per batch | ||
| """ | ||
| import pyarrow as pa | ||
| import pyarrow_hotfix # noqa: F401 | ||
|
|
||
| self._run_pre_execute_hooks(expr) | ||
| table = expr.as_table() | ||
|
|
@@ -1422,7 +1421,6 @@ def execute( | |
| """Execute an expression.""" | ||
| import pandas as pd | ||
| import pyarrow.types as pat | ||
| import pyarrow_hotfix # noqa: F401 | ||
|
|
||
| from ibis.backends.duckdb.converter import DuckDBPandasData | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| from __future__ import annotations | ||
|
|
||
| import pyarrow as pa | ||
|
|
||
| if tuple(int(x) for x in pa.__version__.split(".")[:3]) < (14, 0, 1): | ||
| try: | ||
| import pyarrow_hotfix # noqa: F401 | ||
| except ImportError: | ||
| raise ImportError("pyarrow_hotfix should be installed for pyarrow<14.0.1") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's easy, revert this change that is just restyling so our git diff is cleaner. But not a blocker if you don't get to it.