Skip to content

Commit 6dd80dc

Browse files
committed
Revert unnecessary move
1 parent f719c93 commit 6dd80dc

File tree

2 files changed

+24
-23
lines changed

2 files changed

+24
-23
lines changed

tests/conftest.py

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,10 @@
6262
load_file_io,
6363
)
6464
from pyiceberg.io.fsspec import FsspecFileIO
65+
from pyiceberg.manifest import DataFile, FileFormat
6566
from pyiceberg.schema import Accessor, Schema
6667
from pyiceberg.serializers import ToOutputFile
67-
from pyiceberg.table import Table
68+
from pyiceberg.table import FileScanTask, Table
6869
from pyiceberg.table.metadata import TableMetadataV1, TableMetadataV2
6970
from pyiceberg.types import (
7071
BinaryType,
@@ -1904,6 +1905,28 @@ def clean_up(test_catalog: Catalog) -> None:
19041905
test_catalog.drop_namespace(database_name)
19051906

19061907

1908+
@pytest.fixture
1909+
def data_file(table_schema_simple: Schema, tmp_path: str) -> str:
1910+
import pyarrow as pa
1911+
from pyarrow import parquet as pq
1912+
1913+
table = pa.table(
1914+
{"foo": ["a", "b", "c"], "bar": [1, 2, 3], "baz": [True, False, None]},
1915+
metadata={"iceberg.schema": table_schema_simple.model_dump_json()},
1916+
)
1917+
1918+
file_path = f"{tmp_path}/0000-data.parquet"
1919+
pq.write_table(table=table, where=file_path)
1920+
return file_path
1921+
1922+
1923+
@pytest.fixture
1924+
def example_task(data_file: str) -> FileScanTask:
1925+
return FileScanTask(
1926+
data_file=DataFile(file_path=data_file, file_format=FileFormat.PARQUET, file_size_in_bytes=1925),
1927+
)
1928+
1929+
19071930
@pytest.fixture
19081931
def table_v1(example_table_metadata_v1: Dict[str, Any]) -> Table:
19091932
table_metadata = TableMetadataV1(**example_table_metadata_v1)

tests/io/test_pyarrow.py

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -92,28 +92,6 @@
9292
)
9393

9494

95-
@pytest.fixture
96-
def data_file(table_schema_simple: Schema, tmp_path: str) -> str:
97-
import pyarrow as pa
98-
from pyarrow import parquet as pq
99-
100-
table = pa.table(
101-
{"foo": ["a", "b", "c"], "bar": [1, 2, 3], "baz": [True, False, None]},
102-
metadata={"iceberg.schema": table_schema_simple.model_dump_json()},
103-
)
104-
105-
file_path = f"{tmp_path}/0000-data.parquet"
106-
pq.write_table(table=table, where=file_path)
107-
return file_path
108-
109-
110-
@pytest.fixture
111-
def example_task(data_file: str) -> FileScanTask:
112-
return FileScanTask(
113-
data_file=DataFile(file_path=data_file, file_format=FileFormat.PARQUET, file_size_in_bytes=1925),
114-
)
115-
116-
11795
def test_pyarrow_infer_local_fs_from_path() -> None:
11896
"""Test path with `file` scheme and no scheme both use LocalFileSystem"""
11997
assert isinstance(PyArrowFileIO().new_output("file://tmp/warehouse")._filesystem, LocalFileSystem)

0 commit comments

Comments
 (0)