Skip to content

Commit

Permalink
rebase from main
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinjqliu committed Jan 30, 2024
1 parent 3013bdb commit be3eb1c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 5 additions & 1 deletion pyiceberg/catalog/in_memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
Union,
)

import pyarrow as pa

from pyiceberg.catalog import (
Catalog,
Identifier,
Expand Down Expand Up @@ -51,13 +53,15 @@ def __init__(self, name: str, **properties: str) -> None:
def create_table(
self,
identifier: Union[str, Identifier],
schema: Schema,
schema: Union[Schema, "pa.Schema"],
location: Optional[str] = None,
partition_spec: PartitionSpec = UNPARTITIONED_PARTITION_SPEC,
sort_order: SortOrder = UNSORTED_SORT_ORDER,
properties: Properties = EMPTY_DICT,
table_uuid: Optional[uuid.UUID] = None,
) -> Table:
schema: Schema = self._convert_schema_if_needed(schema) # type: ignore

identifier = Catalog.identifier_to_tuple(identifier)
namespace = Catalog.namespace_from(identifier)

Expand Down
5 changes: 2 additions & 3 deletions tests/catalog/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@
# pylint:disable=redefined-outer-name


import pyarrow as pa
from pathlib import PosixPath
from typing import Union

import pyarrow as pa
import pytest
from pytest_lazyfixture import lazy_fixture

Expand Down Expand Up @@ -160,8 +161,6 @@ def test_create_table_pyarrow_schema(catalog: InMemoryCatalog, pyarrow_schema_si
table = catalog.create_table(
identifier=TEST_TABLE_IDENTIFIER,
schema=pyarrow_schema_simple_without_ids,
location=TEST_TABLE_LOCATION,
partition_spec=TEST_TABLE_PARTITION_SPEC,
properties=TEST_TABLE_PROPERTIES,
)
assert catalog.load_table(TEST_TABLE_IDENTIFIER) == table
Expand Down

0 comments on commit be3eb1c

Please sign in to comment.