From 19854ff78ae84b0f8c03a8e7df8406ed3a37371d Mon Sep 17 00:00:00 2001 From: robot-clickhouse Date: Tue, 12 Nov 2024 17:24:25 +0000 Subject: [PATCH] Automatic style fix --- tests/integration/helpers/cluster.py | 2 +- .../integration/test_database_iceberg/test.py | 41 +++++++++++-------- 2 files changed, 26 insertions(+), 17 deletions(-) diff --git a/tests/integration/helpers/cluster.py b/tests/integration/helpers/cluster.py index 517d0e36865..0d0cf585763 100644 --- a/tests/integration/helpers/cluster.py +++ b/tests/integration/helpers/cluster.py @@ -1481,7 +1481,7 @@ class ClickHouseCluster: p.join(docker_compose_yml_dir, "docker_compose_iceberg_rest_catalog.yml"), ) return self.base_iceberg_catalog_cmd - #return self.base_minio_cmd + # return self.base_minio_cmd def setup_azurite_cmd(self, instance, env_variables, docker_compose_yml_dir): self.with_azurite = True diff --git a/tests/integration/test_database_iceberg/test.py b/tests/integration/test_database_iceberg/test.py index a1f4ad6ad06..43686694a60 100644 --- a/tests/integration/test_database_iceberg/test.py +++ b/tests/integration/test_database_iceberg/test.py @@ -7,28 +7,25 @@ import uuid import pytest import requests -from minio import Minio import urllib3 - -from helpers.test_tools import TSV, csv_compare +from minio import Minio from pyiceberg.catalog import load_catalog +from pyiceberg.partitioning import PartitionField, PartitionSpec from pyiceberg.schema import Schema +from pyiceberg.table.sorting import SortField, SortOrder +from pyiceberg.transforms import DayTransform, IdentityTransform from pyiceberg.types import ( - TimestampType, - FloatType, DoubleType, - StringType, + FloatType, NestedField, + StringType, StructType, + TimestampType, ) -from pyiceberg.partitioning import PartitionSpec, PartitionField -from pyiceberg.transforms import DayTransform -from pyiceberg.table.sorting import SortOrder, SortField -from pyiceberg.transforms import IdentityTransform - from helpers.cluster import ClickHouseCluster, ClickHouseInstance, is_arm from helpers.s3_tools import get_file_contents, list_s3_objects, prepare_s3_bucket +from helpers.test_tools import TSV, csv_compare BASE_URL = "http://rest:8181/v1" BASE_URL_LOCAL = "http://localhost:8181/v1" @@ -192,12 +189,22 @@ def test_simple(started_cluster): def test_different_namespaces(started_cluster): node = started_cluster.instances["node1"] - namespaces = ["A", "A.B.C", "A.B.C.D", "A.B.C.D.E", "A.B.C.D.E.F", "A.B.C.D.E.FF", "B", "B.C", "B.CC"] + namespaces = [ + "A", + "A.B.C", + "A.B.C.D", + "A.B.C.D.E", + "A.B.C.D.E.F", + "A.B.C.D.E.FF", + "B", + "B.C", + "B.CC", + ] tables = ["A", "B", "C", "D", "E", "F"] catalog = load_catalog_impl() for namespace in namespaces: - #if namespace in catalog.list_namespaces()["namesoaces"]: + # if namespace in catalog.list_namespaces()["namesoaces"]: # catalog.drop_namespace(namespace) catalog.create_namespace(namespace) for table in tables: @@ -208,6 +215,8 @@ def test_different_namespaces(started_cluster): for namespace in namespaces: for table in tables: table_name = f"{namespace}.{table}" - assert int(node.query( - f"SELECT count() FROM system.tables WHERE database = '{CATALOG_NAME}' and name = '{table_name}'" - )) + assert int( + node.query( + f"SELECT count() FROM system.tables WHERE database = '{CATALOG_NAME}' and name = '{table_name}'" + ) + )