@@ -494,11 +494,8 @@ def create_table(
494494 import pandas as pd
495495 import pyarrow as pa
496496
497- from ibis .util import apply_pyarrow_hotfix
498-
499- apply_pyarrow_hotfix ()
500-
501497 import ibis .expr .types as ir
498+ from ibis .common import import_to_try_pyarrow_hotfix # noqa: F401
502499
503500 if obj is None and schema is None :
504501 raise exc .IbisError ("`schema` or `obj` is required" )
@@ -941,9 +938,7 @@ def insert(
941938 import pandas as pd
942939 import pyarrow as pa
943940
944- from ibis .util import apply_pyarrow_hotfix
945-
946- apply_pyarrow_hotfix ()
941+ from ibis .common import import_to_try_pyarrow_hotfix # noqa: F401
947942
948943 if isinstance (obj , ir .Table ):
949944 statement = InsertSelect (
@@ -989,9 +984,7 @@ def to_pyarrow(
989984 ) -> pa .Table :
990985 import pyarrow as pa
991986
992- from ibis .util import apply_pyarrow_hotfix
993-
994- apply_pyarrow_hotfix ()
987+ from ibis .common import import_to_try_pyarrow_hotfix # noqa: F401
995988
996989 pyarrow_batches = iter (
997990 self .to_pyarrow_batches (expr , params = params , limit = limit , ** kwargs )
@@ -1019,9 +1012,7 @@ def to_pyarrow_batches(
10191012 ):
10201013 import pyarrow as pa
10211014
1022- from ibis .util import apply_pyarrow_hotfix
1023-
1024- apply_pyarrow_hotfix ()
1015+ from ibis .common import import_to_try_pyarrow_hotfix # noqa: F401
10251016
10261017 ibis_table = expr .as_table ()
10271018
@@ -1071,15 +1062,12 @@ def _from_pyflink_table_to_pyarrow_batches(
10711062 chunk_size : int | None = None ,
10721063 ):
10731064 import pyarrow as pa
1074-
1075- from ibis .util import apply_pyarrow_hotfix
1076-
1077- apply_pyarrow_hotfix ()
10781065 from pyflink .java_gateway import get_gateway
10791066 from pyflink .table .serializers import ArrowSerializer
10801067 from pyflink .table .types import create_arrow_schema
10811068
10821069 from ibis .backends .flink .datatypes import get_field_data_types
1070+ from ibis .common import import_to_try_pyarrow_hotfix # noqa: F401
10831071 # Note (mehmet): Implementation of this is based on
10841072 # pyflink/table/table.py: to_pandas().
10851073
0 commit comments