Skip to content

Commit

Permalink
Allow running the Avro decoder tests without Arrow (#335)
Browse files Browse the repository at this point in the history
* Allow running the Avro decoder tests without Arrow

It looks like PyArrow binaries are not available
for all architectures, and therefore it tries to
compile it locally when it isn't available.

We want to avoid this since Arrow requires a rather
complicated buildchain.

* Revert unnecessary move
  • Loading branch information
Fokko authored Jan 31, 2024
1 parent 102e043 commit b7cf14e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
CIBW_ARCHS: "auto64"
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.8,<3.12"
CIBW_TEST_REQUIRES: "pytest==7.4.2 moto==4.2.2"
CIBW_TEST_EXTRAS: "s3fs,glue,pyarrow"
CIBW_TEST_EXTRAS: "s3fs,glue"
CIBW_TEST_COMMAND: "pytest {project}/tests/avro/test_decoder.py"
# There is an upstream issue with installing on MacOSX
# https://github.com/pypa/cibuildwheel/issues/1603
Expand Down
10 changes: 7 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
from urllib.parse import urlparse

import boto3
import pyarrow as pa
import pytest
from moto import mock_dynamodb, mock_glue

Expand Down Expand Up @@ -85,6 +84,7 @@
from pyiceberg.utils.datetime import datetime_to_millis

if TYPE_CHECKING:
import pyarrow as pa
from moto.server import ThreadedMotoServer # type: ignore

from pyiceberg.io.pyarrow import PyArrowFile, PyArrowFileIO
Expand Down Expand Up @@ -267,7 +267,9 @@ def table_schema_nested_with_struct_key_map() -> Schema:


@pytest.fixture(scope="session")
def pyarrow_schema_simple_without_ids() -> pa.Schema:
def pyarrow_schema_simple_without_ids() -> "pa.Schema":
import pyarrow as pa

return pa.schema([
pa.field('foo', pa.string(), nullable=True),
pa.field('bar', pa.int32(), nullable=False),
Expand All @@ -276,7 +278,9 @@ def pyarrow_schema_simple_without_ids() -> pa.Schema:


@pytest.fixture(scope="session")
def pyarrow_schema_nested_without_ids() -> pa.Schema:
def pyarrow_schema_nested_without_ids() -> "pa.Schema":
import pyarrow as pa

return pa.schema([
pa.field('foo', pa.string(), nullable=False),
pa.field('bar', pa.int32(), nullable=False),
Expand Down

0 comments on commit b7cf14e

Please sign in to comment.