From 080b5c2b7b91ab7b0ef1d797e8b7b5a202ce091c Mon Sep 17 00:00:00 2001 From: John Kerl Date: Tue, 21 Nov 2023 16:14:47 -0500 Subject: [PATCH] round n+1 of code review --- apis/python/src/tiledbsoma/__init__.py | 5 +++++ apis/python/src/tiledbsoma/_arrow_types.py | 3 --- apis/python/src/tiledbsoma/_common_nd_array.py | 3 --- apis/python/src/tiledbsoma/_dataframe.py | 3 --- apis/python/src/tiledbsoma/_dense_nd_array.py | 3 --- apis/python/src/tiledbsoma/_read_iters.py | 3 --- apis/python/src/tiledbsoma/_sparse_nd_array.py | 3 --- apis/python/src/tiledbsoma/_tiledb_array.py | 3 --- apis/python/src/tiledbsoma/_types.py | 3 --- apis/python/src/tiledbsoma/experiment_query.py | 3 --- apis/python/src/tiledbsoma/io/_registration/signatures.py | 3 --- apis/python/src/tiledbsoma/io/ingest.py | 3 --- apis/python/tests/__init__.py | 3 --- apis/python/tests/test_collection.py | 3 --- apis/python/tests/test_dataframe.py | 3 --- apis/python/tests/test_dataframe_index_columns.py | 3 --- apis/python/tests/test_dense_nd_array.py | 3 --- apis/python/tests/test_experiment_basic.py | 3 --- apis/python/tests/test_experiment_query.py | 3 --- apis/python/tests/test_io.py | 3 --- apis/python/tests/test_metadata.py | 3 --- apis/python/tests/test_sparse_nd_array.py | 3 --- apis/python/tests/test_tiledbobject.py | 3 --- apis/python/tests/test_type_system.py | 3 --- apis/python/tests/test_unicode.py | 3 --- apis/python/tests/test_update_dataframes.py | 3 --- apis/python/tests/test_util_tiledb.py | 3 --- 27 files changed, 5 insertions(+), 78 deletions(-) diff --git a/apis/python/src/tiledbsoma/__init__.py b/apis/python/src/tiledbsoma/__init__.py index 50bf25770f..f6a6611373 100644 --- a/apis/python/src/tiledbsoma/__init__.py +++ b/apis/python/src/tiledbsoma/__init__.py @@ -96,6 +96,11 @@ from somacore import AxisColumnNames, AxisQuery, ExperimentAxisQuery from somacore.options import ResultOrder +# TODO: once we no longer support Python 3.7, remove this and pin to pyarrow >= 14.0.1 +# https://github.com/single-cell-data/TileDB-SOMA/issues/1926 +# ruff: noqa +import pyarrow_hotfix + from ._collection import Collection from ._constants import SOMA_JOINID from ._dataframe import DataFrame diff --git a/apis/python/src/tiledbsoma/_arrow_types.py b/apis/python/src/tiledbsoma/_arrow_types.py index 24a9932372..75bd04db00 100644 --- a/apis/python/src/tiledbsoma/_arrow_types.py +++ b/apis/python/src/tiledbsoma/_arrow_types.py @@ -32,9 +32,6 @@ import numpy.typing as npt import pandas as pd import pyarrow as pa - -# ruff: noqa -import pyarrow_hotfix import tiledb _ARROW_TO_TDB_ATTR: Dict[Any, Union[str, TypeError]] = { diff --git a/apis/python/src/tiledbsoma/_common_nd_array.py b/apis/python/src/tiledbsoma/_common_nd_array.py index ce8224c717..9c7491dc6e 100644 --- a/apis/python/src/tiledbsoma/_common_nd_array.py +++ b/apis/python/src/tiledbsoma/_common_nd_array.py @@ -9,9 +9,6 @@ import numpy as np import pyarrow as pa - -# ruff: noqa -import pyarrow_hotfix import somacore import tiledb from somacore import options diff --git a/apis/python/src/tiledbsoma/_dataframe.py b/apis/python/src/tiledbsoma/_dataframe.py index 9cd49428a4..127edf2794 100644 --- a/apis/python/src/tiledbsoma/_dataframe.py +++ b/apis/python/src/tiledbsoma/_dataframe.py @@ -11,9 +11,6 @@ import numpy as np import pandas as pd import pyarrow as pa - -# ruff: noqa -import pyarrow_hotfix import somacore import tiledb from somacore import options diff --git a/apis/python/src/tiledbsoma/_dense_nd_array.py b/apis/python/src/tiledbsoma/_dense_nd_array.py index 3c7c39d08f..82030254ea 100644 --- a/apis/python/src/tiledbsoma/_dense_nd_array.py +++ b/apis/python/src/tiledbsoma/_dense_nd_array.py @@ -10,9 +10,6 @@ from typing import Optional, Tuple import pyarrow as pa - -# ruff: noqa -import pyarrow_hotfix import somacore from somacore import options from typing_extensions import Self diff --git a/apis/python/src/tiledbsoma/_read_iters.py b/apis/python/src/tiledbsoma/_read_iters.py index 2f0235c1a3..999a96fc67 100644 --- a/apis/python/src/tiledbsoma/_read_iters.py +++ b/apis/python/src/tiledbsoma/_read_iters.py @@ -26,9 +26,6 @@ import numpy.typing as npt import pandas as pd import pyarrow as pa - -# ruff: noqa -import pyarrow_hotfix import somacore from scipy import sparse from somacore import options diff --git a/apis/python/src/tiledbsoma/_sparse_nd_array.py b/apis/python/src/tiledbsoma/_sparse_nd_array.py index f521e0cb16..880e5be720 100644 --- a/apis/python/src/tiledbsoma/_sparse_nd_array.py +++ b/apis/python/src/tiledbsoma/_sparse_nd_array.py @@ -19,9 +19,6 @@ import numpy as np import pyarrow as pa - -# ruff: noqa -import pyarrow_hotfix import pyarrow.compute as pacomp import somacore import tiledb diff --git a/apis/python/src/tiledbsoma/_tiledb_array.py b/apis/python/src/tiledbsoma/_tiledb_array.py index e438351530..80ba8147b4 100644 --- a/apis/python/src/tiledbsoma/_tiledb_array.py +++ b/apis/python/src/tiledbsoma/_tiledb_array.py @@ -9,9 +9,6 @@ from typing import Any, Dict, List, Optional, Sequence, Tuple import pyarrow as pa - -# ruff: noqa -import pyarrow_hotfix import tiledb from somacore.options import ResultOrder, ResultOrderStr diff --git a/apis/python/src/tiledbsoma/_types.py b/apis/python/src/tiledbsoma/_types.py index 5f2a5f6d73..2874addb59 100644 --- a/apis/python/src/tiledbsoma/_types.py +++ b/apis/python/src/tiledbsoma/_types.py @@ -11,9 +11,6 @@ import numpy.typing as npt import pandas as pd import pyarrow as pa - -# ruff: noqa -import pyarrow_hotfix from somacore import types from typing_extensions import Literal diff --git a/apis/python/src/tiledbsoma/experiment_query.py b/apis/python/src/tiledbsoma/experiment_query.py index 09b3640d77..e6f76fcf1a 100644 --- a/apis/python/src/tiledbsoma/experiment_query.py +++ b/apis/python/src/tiledbsoma/experiment_query.py @@ -8,9 +8,6 @@ import pandas as pd import pyarrow as pa -# ruff: noqa -import pyarrow_hotfix - from ._types import NPNDArray, PDSeries diff --git a/apis/python/src/tiledbsoma/io/_registration/signatures.py b/apis/python/src/tiledbsoma/io/_registration/signatures.py index ada722f0cb..d8ea978690 100644 --- a/apis/python/src/tiledbsoma/io/_registration/signatures.py +++ b/apis/python/src/tiledbsoma/io/_registration/signatures.py @@ -5,9 +5,6 @@ import attrs import pandas as pd import pyarrow as pa - -# ruff: noqa -import pyarrow_hotfix from typing_extensions import Self import tiledbsoma diff --git a/apis/python/src/tiledbsoma/io/ingest.py b/apis/python/src/tiledbsoma/io/ingest.py index ca0fced16a..f1256f6170 100644 --- a/apis/python/src/tiledbsoma/io/ingest.py +++ b/apis/python/src/tiledbsoma/io/ingest.py @@ -33,9 +33,6 @@ import numpy as np import pandas as pd import pyarrow as pa - -# ruff: noqa -import pyarrow_hotfix import scipy.sparse as sp import tiledb from anndata._core import file_backing diff --git a/apis/python/tests/__init__.py b/apis/python/tests/__init__.py index d875b2220f..1211fe935e 100644 --- a/apis/python/tests/__init__.py +++ b/apis/python/tests/__init__.py @@ -1,7 +1,4 @@ import pyarrow as pa - -# ruff: noqa -import pyarrow_hotfix from typeguard.importhook import install_import_hook # avoid typeguard by importing before calling install_import_hook diff --git a/apis/python/tests/test_collection.py b/apis/python/tests/test_collection.py index 157d0158b8..8564a30dbd 100644 --- a/apis/python/tests/test_collection.py +++ b/apis/python/tests/test_collection.py @@ -6,9 +6,6 @@ import numpy as np import pandas as pd import pyarrow as pa - -# ruff: noqa -import pyarrow_hotfix import pytest from typing_extensions import Literal diff --git a/apis/python/tests/test_dataframe.py b/apis/python/tests/test_dataframe.py index 7d093e4a5a..820979eafe 100644 --- a/apis/python/tests/test_dataframe.py +++ b/apis/python/tests/test_dataframe.py @@ -4,9 +4,6 @@ import numpy as np import pandas as pd import pyarrow as pa - -# ruff: noqa -import pyarrow_hotfix import pytest import somacore import tiledb diff --git a/apis/python/tests/test_dataframe_index_columns.py b/apis/python/tests/test_dataframe_index_columns.py index 869e344cfa..3348572cbd 100644 --- a/apis/python/tests/test_dataframe_index_columns.py +++ b/apis/python/tests/test_dataframe_index_columns.py @@ -1,8 +1,5 @@ import numpy as np import pyarrow as pa - -# ruff: noqa -import pyarrow_hotfix import pytest import tiledb diff --git a/apis/python/tests/test_dense_nd_array.py b/apis/python/tests/test_dense_nd_array.py index 68cd22605b..47d363058b 100644 --- a/apis/python/tests/test_dense_nd_array.py +++ b/apis/python/tests/test_dense_nd_array.py @@ -3,9 +3,6 @@ import numpy as np import pyarrow as pa - -# ruff: noqa -import pyarrow_hotfix import pytest import tiledb diff --git a/apis/python/tests/test_experiment_basic.py b/apis/python/tests/test_experiment_basic.py index 3ae71882c9..513217afcd 100644 --- a/apis/python/tests/test_experiment_basic.py +++ b/apis/python/tests/test_experiment_basic.py @@ -2,9 +2,6 @@ import numpy as np import pyarrow as pa - -# ruff: noqa -import pyarrow_hotfix import pytest import tiledbsoma as soma diff --git a/apis/python/tests/test_experiment_query.py b/apis/python/tests/test_experiment_query.py index 18494254cd..e6113192ba 100644 --- a/apis/python/tests/test_experiment_query.py +++ b/apis/python/tests/test_experiment_query.py @@ -3,9 +3,6 @@ import numpy as np import pandas as pd import pyarrow as pa - -# ruff: noqa -import pyarrow_hotfix import pytest from scipy import sparse from somacore import options diff --git a/apis/python/tests/test_io.py b/apis/python/tests/test_io.py index f514a79c7d..d8919b9e79 100644 --- a/apis/python/tests/test_io.py +++ b/apis/python/tests/test_io.py @@ -1,8 +1,5 @@ import numpy as np import pyarrow as pa - -# ruff: noqa -import pyarrow_hotfix import pytest from scipy import sparse as sp diff --git a/apis/python/tests/test_metadata.py b/apis/python/tests/test_metadata.py index 2925c8ae4b..bbdc45832a 100644 --- a/apis/python/tests/test_metadata.py +++ b/apis/python/tests/test_metadata.py @@ -3,9 +3,6 @@ import numpy as np import pyarrow as pa - -# ruff: noqa -import pyarrow_hotfix import pytest import tiledbsoma as soma diff --git a/apis/python/tests/test_sparse_nd_array.py b/apis/python/tests/test_sparse_nd_array.py index 738ae96a87..9e6086f91d 100644 --- a/apis/python/tests/test_sparse_nd_array.py +++ b/apis/python/tests/test_sparse_nd_array.py @@ -8,9 +8,6 @@ import numpy as np import pyarrow as pa - -# ruff: noqa -import pyarrow_hotfix import pytest import scipy.sparse as sparse import tiledb diff --git a/apis/python/tests/test_tiledbobject.py b/apis/python/tests/test_tiledbobject.py index ad7f75cc4d..b13ae5576e 100644 --- a/apis/python/tests/test_tiledbobject.py +++ b/apis/python/tests/test_tiledbobject.py @@ -1,7 +1,4 @@ import pyarrow as pa - -# ruff: noqa -import pyarrow_hotfix import pytest import tiledbsoma as soma diff --git a/apis/python/tests/test_type_system.py b/apis/python/tests/test_type_system.py index ca18e31adc..9c677dba55 100644 --- a/apis/python/tests/test_type_system.py +++ b/apis/python/tests/test_type_system.py @@ -1,9 +1,6 @@ import pathlib import pyarrow as pa - -# ruff: noqa -import pyarrow_hotfix import pytest import tiledbsoma as soma diff --git a/apis/python/tests/test_unicode.py b/apis/python/tests/test_unicode.py index ce61e50e19..4b59fd4646 100644 --- a/apis/python/tests/test_unicode.py +++ b/apis/python/tests/test_unicode.py @@ -1,9 +1,6 @@ import numpy as np import pandas as pd import pyarrow as pa - -# ruff: noqa -import pyarrow_hotfix import pytest import tiledbsoma as soma diff --git a/apis/python/tests/test_update_dataframes.py b/apis/python/tests/test_update_dataframes.py index bb993bfbdb..484f19ab31 100644 --- a/apis/python/tests/test_update_dataframes.py +++ b/apis/python/tests/test_update_dataframes.py @@ -5,9 +5,6 @@ import numpy as np import pandas as pd import pyarrow as pa - -# ruff: noqa -import pyarrow_hotfix import pytest import tiledbsoma diff --git a/apis/python/tests/test_util_tiledb.py b/apis/python/tests/test_util_tiledb.py index d1e32179f6..c96cdcacf7 100644 --- a/apis/python/tests/test_util_tiledb.py +++ b/apis/python/tests/test_util_tiledb.py @@ -1,7 +1,4 @@ import pyarrow as pa - -# ruff: noqa -import pyarrow_hotfix import pytest import tiledb