Skip to content

Commit c0a32a5

Browse files
Gayathri Srividya RajavarapuGayathri Srividya Rajavarapu
authored andcommitted
Apply formatter fixes for lazy pagination changes
1 parent 7e1538e commit c0a32a5

3 files changed

Lines changed: 16 additions & 15 deletions

File tree

pyiceberg/catalog/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,9 @@
2222
import re
2323
import uuid
2424
from abc import ABC, abstractmethod
25-
from collections.abc import Callable
25+
from collections.abc import Callable, Iterator
2626
from dataclasses import dataclass
2727
from enum import Enum
28-
from collections.abc import Iterator
2928
from typing import (
3029
TYPE_CHECKING,
3130
Any,

pyiceberg/catalog/hive.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -777,13 +777,15 @@ def list_tables(self, namespace: str | Identifier) -> Iterator[Identifier]:
777777
"""
778778
database_name = self.identifier_to_database(namespace, NoSuchNamespaceError)
779779
with self._client as open_client:
780-
return iter([
781-
(database_name, table.tableName)
782-
for table in open_client.get_table_objects_by_name(
783-
dbname=database_name, tbl_names=open_client.get_all_tables(db_name=database_name)
784-
)
785-
if table.parameters.get(TABLE_TYPE, "").lower() == ICEBERG
786-
])
780+
return iter(
781+
[
782+
(database_name, table.tableName)
783+
for table in open_client.get_table_objects_by_name(
784+
dbname=database_name, tbl_names=open_client.get_all_tables(db_name=database_name)
785+
)
786+
if table.parameters.get(TABLE_TYPE, "").lower() == ICEBERG
787+
]
788+
)
787789

788790
@override
789791
def list_namespaces(self, namespace: str | Identifier = ()) -> Iterator[Identifier]:

tests/catalog/test_rest.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -597,9 +597,9 @@ def test_list_tables_200_sigv4(rest_mock: Mocker) -> None:
597597
request_headers=TEST_HEADERS,
598598
)
599599

600-
assert list(RestCatalog("rest", **{"uri": TEST_URI, "token": TEST_TOKEN, "rest.sigv4-enabled": "true"}).list_tables(namespace)) == [
601-
("examples", "fooshare")
602-
]
600+
assert list(
601+
RestCatalog("rest", **{"uri": TEST_URI, "token": TEST_TOKEN, "rest.sigv4-enabled": "true"}).list_tables(namespace)
602+
) == [("examples", "fooshare")]
603603
assert rest_mock.called
604604

605605

@@ -885,9 +885,9 @@ def test_list_views_200_sigv4(rest_mock: Mocker) -> None:
885885
request_headers=TEST_HEADERS,
886886
)
887887

888-
assert list(RestCatalog("rest", **{"uri": TEST_URI, "token": TEST_TOKEN, "rest.sigv4-enabled": "true"}).list_views(namespace)) == [
889-
("examples", "fooshare")
890-
]
888+
assert list(
889+
RestCatalog("rest", **{"uri": TEST_URI, "token": TEST_TOKEN, "rest.sigv4-enabled": "true"}).list_views(namespace)
890+
) == [("examples", "fooshare")]
891891
assert rest_mock.called
892892

893893

0 commit comments

Comments
 (0)