Skip to content

Commit be3eb1c

Browse files
committed
rebase from main
1 parent 3013bdb commit be3eb1c

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

pyiceberg/catalog/in_memory.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
Union,
88
)
99

10+
import pyarrow as pa
11+
1012
from pyiceberg.catalog import (
1113
Catalog,
1214
Identifier,
@@ -51,13 +53,15 @@ def __init__(self, name: str, **properties: str) -> None:
5153
def create_table(
5254
self,
5355
identifier: Union[str, Identifier],
54-
schema: Schema,
56+
schema: Union[Schema, "pa.Schema"],
5557
location: Optional[str] = None,
5658
partition_spec: PartitionSpec = UNPARTITIONED_PARTITION_SPEC,
5759
sort_order: SortOrder = UNSORTED_SORT_ORDER,
5860
properties: Properties = EMPTY_DICT,
5961
table_uuid: Optional[uuid.UUID] = None,
6062
) -> Table:
63+
schema: Schema = self._convert_schema_if_needed(schema) # type: ignore
64+
6165
identifier = Catalog.identifier_to_tuple(identifier)
6266
namespace = Catalog.namespace_from(identifier)
6367

tests/catalog/test_base.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@
1717
# pylint:disable=redefined-outer-name
1818

1919

20-
import pyarrow as pa
2120
from pathlib import PosixPath
21+
from typing import Union
2222

23+
import pyarrow as pa
2324
import pytest
2425
from pytest_lazyfixture import lazy_fixture
2526

@@ -160,8 +161,6 @@ def test_create_table_pyarrow_schema(catalog: InMemoryCatalog, pyarrow_schema_si
160161
table = catalog.create_table(
161162
identifier=TEST_TABLE_IDENTIFIER,
162163
schema=pyarrow_schema_simple_without_ids,
163-
location=TEST_TABLE_LOCATION,
164-
partition_spec=TEST_TABLE_PARTITION_SPEC,
165164
properties=TEST_TABLE_PROPERTIES,
166165
)
167166
assert catalog.load_table(TEST_TABLE_IDENTIFIER) == table

0 commit comments

Comments
 (0)