Skip to content

Commit 92ff522

Browse files
committed
ignore E501 in tests
1 parent 91695c0 commit 92ff522

24 files changed

+101
-95
lines changed

tests/catalog/test_hive.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -970,7 +970,7 @@ def test_rename_table_to_namespace_does_not_exists() -> None:
970970

971971
catalog._client = MagicMock()
972972
catalog._client.__enter__().alter_table_with_environment_context.side_effect = InvalidOperationException(
973-
message="Unable to change partition or table. Database default does not exist Check metastore logs for detailed stack.does_not_exists"
973+
message="Unable to change partition or table. Database default does not exist Check metastore logs for detailed stack.does_not_exists" # noqa: E501
974974
)
975975

976976
with pytest.raises(NoSuchNamespaceError) as exc_info:

tests/catalog/test_rest.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def test_no_uri_supplied() -> None:
156156

157157

158158
@pytest.mark.filterwarnings(
159-
"ignore:Deprecated in 0.8.0, will be removed in 1.0.0. Iceberg REST client is missing the OAuth2 server URI:DeprecationWarning"
159+
"ignore:Deprecated in 0.8.0, will be removed in 1.0.0. Iceberg REST client is missing the OAuth2 server URI:DeprecationWarning" # noqa: E501
160160
)
161161
def test_token_200(rest_mock: Mocker) -> None:
162162
rest_mock.post(
@@ -179,7 +179,7 @@ def test_token_200(rest_mock: Mocker) -> None:
179179

180180

181181
@pytest.mark.filterwarnings(
182-
"ignore:Deprecated in 0.8.0, will be removed in 1.0.0. Iceberg REST client is missing the OAuth2 server URI:DeprecationWarning"
182+
"ignore:Deprecated in 0.8.0, will be removed in 1.0.0. Iceberg REST client is missing the OAuth2 server URI:DeprecationWarning" # noqa: E501
183183
)
184184
def test_token_200_without_optional_fields(rest_mock: Mocker) -> None:
185185
rest_mock.post(
@@ -198,7 +198,7 @@ def test_token_200_without_optional_fields(rest_mock: Mocker) -> None:
198198

199199

200200
@pytest.mark.filterwarnings(
201-
"ignore:Deprecated in 0.8.0, will be removed in 1.0.0. Iceberg REST client is missing the OAuth2 server URI:DeprecationWarning"
201+
"ignore:Deprecated in 0.8.0, will be removed in 1.0.0. Iceberg REST client is missing the OAuth2 server URI:DeprecationWarning" # noqa: E501
202202
)
203203
def test_token_with_optional_oauth_params(rest_mock: Mocker) -> None:
204204
mock_request = rest_mock.post(
@@ -223,7 +223,7 @@ def test_token_with_optional_oauth_params(rest_mock: Mocker) -> None:
223223

224224

225225
@pytest.mark.filterwarnings(
226-
"ignore:Deprecated in 0.8.0, will be removed in 1.0.0. Iceberg REST client is missing the OAuth2 server URI:DeprecationWarning"
226+
"ignore:Deprecated in 0.8.0, will be removed in 1.0.0. Iceberg REST client is missing the OAuth2 server URI:DeprecationWarning" # noqa: E501
227227
)
228228
def test_token_with_optional_oauth_params_as_empty(rest_mock: Mocker) -> None:
229229
mock_request = rest_mock.post(
@@ -246,7 +246,7 @@ def test_token_with_optional_oauth_params_as_empty(rest_mock: Mocker) -> None:
246246

247247

248248
@pytest.mark.filterwarnings(
249-
"ignore:Deprecated in 0.8.0, will be removed in 1.0.0. Iceberg REST client is missing the OAuth2 server URI:DeprecationWarning"
249+
"ignore:Deprecated in 0.8.0, will be removed in 1.0.0. Iceberg REST client is missing the OAuth2 server URI:DeprecationWarning" # noqa: E501
250250
)
251251
def test_token_with_default_scope(rest_mock: Mocker) -> None:
252252
mock_request = rest_mock.post(
@@ -267,7 +267,7 @@ def test_token_with_default_scope(rest_mock: Mocker) -> None:
267267

268268

269269
@pytest.mark.filterwarnings(
270-
"ignore:Deprecated in 0.8.0, will be removed in 1.0.0. Iceberg REST client is missing the OAuth2 server URI:DeprecationWarning"
270+
"ignore:Deprecated in 0.8.0, will be removed in 1.0.0. Iceberg REST client is missing the OAuth2 server URI:DeprecationWarning" # noqa: E501
271271
)
272272
def test_token_with_custom_scope(rest_mock: Mocker) -> None:
273273
mock_request = rest_mock.post(
@@ -289,7 +289,7 @@ def test_token_with_custom_scope(rest_mock: Mocker) -> None:
289289

290290

291291
@pytest.mark.filterwarnings(
292-
"ignore:Deprecated in 0.8.0, will be removed in 1.0.0. Iceberg REST client is missing the OAuth2 server URI:DeprecationWarning"
292+
"ignore:Deprecated in 0.8.0, will be removed in 1.0.0. Iceberg REST client is missing the OAuth2 server URI:DeprecationWarning" # noqa: E501
293293
)
294294
def test_token_200_w_oauth2_server_uri(rest_mock: Mocker) -> None:
295295
rest_mock.post(
@@ -314,7 +314,7 @@ def test_token_200_w_oauth2_server_uri(rest_mock: Mocker) -> None:
314314

315315

316316
@pytest.mark.filterwarnings(
317-
"ignore:Deprecated in 0.8.0, will be removed in 1.0.0. Iceberg REST client is missing the OAuth2 server URI:DeprecationWarning"
317+
"ignore:Deprecated in 0.8.0, will be removed in 1.0.0. Iceberg REST client is missing the OAuth2 server URI:DeprecationWarning" # noqa: E501
318318
)
319319
def test_config_200(requests_mock: Mocker) -> None:
320320
requests_mock.get(
@@ -402,7 +402,7 @@ def test_config_sets_headers(requests_mock: Mocker) -> None:
402402

403403

404404
@pytest.mark.filterwarnings(
405-
"ignore:Deprecated in 0.8.0, will be removed in 1.0.0. Iceberg REST client is missing the OAuth2 server URI:DeprecationWarning"
405+
"ignore:Deprecated in 0.8.0, will be removed in 1.0.0. Iceberg REST client is missing the OAuth2 server URI:DeprecationWarning" # noqa: E501
406406
)
407407
def test_token_400(rest_mock: Mocker) -> None:
408408
rest_mock.post(
@@ -418,7 +418,7 @@ def test_token_400(rest_mock: Mocker) -> None:
418418

419419

420420
@pytest.mark.filterwarnings(
421-
"ignore:Deprecated in 0.8.0, will be removed in 1.0.0. Iceberg REST client is missing the OAuth2 server URI:DeprecationWarning"
421+
"ignore:Deprecated in 0.8.0, will be removed in 1.0.0. Iceberg REST client is missing the OAuth2 server URI:DeprecationWarning" # noqa: E501
422422
)
423423
def test_token_401(rest_mock: Mocker) -> None:
424424
message = "invalid_client"
@@ -664,7 +664,7 @@ def test_list_namespace_with_parent_404(rest_mock: Mocker) -> None:
664664

665665

666666
@pytest.mark.filterwarnings(
667-
"ignore:Deprecated in 0.8.0, will be removed in 1.0.0. Iceberg REST client is missing the OAuth2 server URI:DeprecationWarning"
667+
"ignore:Deprecated in 0.8.0, will be removed in 1.0.0. Iceberg REST client is missing the OAuth2 server URI:DeprecationWarning" # noqa: E501
668668
)
669669
@pytest.mark.parametrize("status_code", [401, 419])
670670
def test_list_namespaces_token_expired_success_on_retries(rest_mock: Mocker, status_code: int) -> None:
@@ -2017,7 +2017,7 @@ def test_custom_namespace_separator(rest_mock: Mocker) -> None:
20172017

20182018

20192019
@pytest.mark.filterwarnings(
2020-
"ignore:Deprecated in 0.8.0, will be removed in 1.0.0. Iceberg REST client is missing the OAuth2 server URI:DeprecationWarning"
2020+
"ignore:Deprecated in 0.8.0, will be removed in 1.0.0. Iceberg REST client is missing the OAuth2 server URI:DeprecationWarning" # noqa: E501
20212021
)
20222022
def test_auth_header(rest_mock: Mocker) -> None:
20232023
mock_request = rest_mock.post(

tests/cli/test_console.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@ def test_json_schema(catalog: InMemoryCatalog) -> None:
629629
assert result.exit_code == 0
630630
assert (
631631
result.output
632-
== """{"type":"struct","fields":[{"id":1,"name":"x","type":"long","required":true},{"id":2,"name":"y","type":"long","required":true,"doc":"comment"},{"id":3,"name":"z","type":"long","required":true}],"schema-id":0,"identifier-field-ids":[]}\n"""
632+
== """{"type":"struct","fields":[{"id":1,"name":"x","type":"long","required":true},{"id":2,"name":"y","type":"long","required":true,"doc":"comment"},{"id":3,"name":"z","type":"long","required":true}],"schema-id":0,"identifier-field-ids":[]}\n""" # noqa: E501
633633
)
634634

635635

@@ -821,7 +821,7 @@ def test_json_properties_get_table_specific_property_that_doesnt_exist(catalog:
821821
assert result.exit_code == 1
822822
assert (
823823
result.output
824-
== """{"type": "NoSuchPropertyException", "message": "Could not find property doesnotexist on table default.my_table"}\n"""
824+
== """{"type": "NoSuchPropertyException", "message": "Could not find property doesnotexist on table default.my_table"}\n""" # noqa: E501
825825
)
826826

827827

tests/conftest.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,7 +1188,7 @@ def metadata_location_gz(tmp_path_factory: pytest.TempPathFactory) -> str:
11881188
"status": 1,
11891189
"snapshot_id": 8744736658442914487,
11901190
"data_file": {
1191-
"file_path": "/home/iceberg/warehouse/nyc/taxis_partitioned/data/VendorID=null/00000-633-d8a4223e-dc97-45a1-86e1-adaba6e8abd7-00001.parquet",
1191+
"file_path": "/home/iceberg/warehouse/nyc/taxis_partitioned/data/VendorID=null/00000-633-d8a4223e-dc97-45a1-86e1-adaba6e8abd7-00001.parquet", # noqa: E501
11921192
"file_format": "PARQUET",
11931193
"partition": {"VendorID": 1, "tpep_pickup_day": 1925},
11941194
"record_count": 19513,
@@ -1308,7 +1308,7 @@ def metadata_location_gz(tmp_path_factory: pytest.TempPathFactory) -> str:
13081308
"status": 1,
13091309
"snapshot_id": 8744736658442914487,
13101310
"data_file": {
1311-
"file_path": "/home/iceberg/warehouse/nyc/taxis_partitioned/data/VendorID=1/00000-633-d8a4223e-dc97-45a1-86e1-adaba6e8abd7-00002.parquet",
1311+
"file_path": "/home/iceberg/warehouse/nyc/taxis_partitioned/data/VendorID=1/00000-633-d8a4223e-dc97-45a1-86e1-adaba6e8abd7-00002.parquet", # noqa: E501
13121312
"file_format": "PARQUET",
13131313
"partition": {"VendorID": 1, "tpep_pickup_datetime": None},
13141314
"record_count": 95050,
@@ -2146,7 +2146,7 @@ def adls_fsspec_fileio(request: pytest.FixtureRequest) -> Generator[FsspecFileIO
21462146
azurite_url = request.config.getoption("--adls.endpoint")
21472147
azurite_account_name = request.config.getoption("--adls.account-name")
21482148
azurite_account_key = request.config.getoption("--adls.account-key")
2149-
azurite_connection_string = f"DefaultEndpointsProtocol=http;AccountName={azurite_account_name};AccountKey={azurite_account_key};BlobEndpoint={azurite_url}/{azurite_account_name};"
2149+
azurite_connection_string = f"DefaultEndpointsProtocol=http;AccountName={azurite_account_name};AccountKey={azurite_account_key};BlobEndpoint={azurite_url}/{azurite_account_name};" # noqa: E501
21502150
properties = {
21512151
"adls.connection-string": azurite_connection_string,
21522152
"adls.account-name": azurite_account_name,
@@ -2183,7 +2183,7 @@ def pyarrow_fileio_adls(request: pytest.FixtureRequest) -> Generator[Any, None,
21832183

21842184
azurite_account_name = request.config.getoption("--adls.account-name")
21852185
azurite_account_key = request.config.getoption("--adls.account-key")
2186-
azurite_connection_string = f"DefaultEndpointsProtocol=http;AccountName={azurite_account_name};AccountKey={azurite_account_key};BlobEndpoint={azurite_url}/{azurite_account_name};"
2186+
azurite_connection_string = f"DefaultEndpointsProtocol=http;AccountName={azurite_account_name};AccountKey={azurite_account_key};BlobEndpoint={azurite_url}/{azurite_account_name};" # noqa: E501
21872187
properties = {
21882188
ADLS_ACCOUNT_NAME: azurite_account_name,
21892189
ADLS_ACCOUNT_KEY: azurite_account_key,
@@ -2623,7 +2623,7 @@ def spark() -> "SparkSession":
26232623
# Not supported by Spark
26242624
# 'time': [time(1, 22, 0), None, time(19, 25, 0)],
26252625
# Not natively supported by Arrow
2626-
# 'uuid': [uuid.UUID('00000000-0000-0000-0000-000000000000').bytes, None, uuid.UUID('11111111-1111-1111-1111-111111111111').bytes],
2626+
# 'uuid': [uuid.UUID('00000000-0000-0000-0000-000000000000').bytes, None, uuid.UUID('11111111-1111-1111-1111-111111111111').bytes], # noqa: E501
26272627
"binary": [b"\01", None, b"\22"],
26282628
"fixed": [
26292629
uuid.UUID("00000000-0000-0000-0000-000000000000").bytes,
@@ -2676,7 +2676,7 @@ def arrow_table_with_null(pa_schema: "pa.Schema") -> "pa.Table":
26762676
"long": [1, None, 9],
26772677
"float": [0.0, None, 0.9],
26782678
"double": [0.0, None, 0.9],
2679-
# 'time': [1_000_000, None, 3_000_000], # Example times: 1s, none, and 3s past midnight #Spark does not support time fields
2679+
# 'time': [1_000_000, None, 3_000_000], # Example times: 1s, none, and 3s past midnight #Spark does not support time fields # noqa: E501
26802680
"timestamp": [datetime(2023, 1, 1, 19, 25, 00), None, datetime(2023, 3, 1, 19, 25, 00)],
26812681
"timestamptz": [
26822682
datetime(2023, 1, 1, 19, 25, 00, tzinfo=timezone.utc),
@@ -2687,7 +2687,7 @@ def arrow_table_with_null(pa_schema: "pa.Schema") -> "pa.Table":
26872687
# Not supported by Spark
26882688
# 'time': [time(1, 22, 0), None, time(19, 25, 0)],
26892689
# Not natively supported by Arrow
2690-
# 'uuid': [uuid.UUID('00000000-0000-0000-0000-000000000000').bytes, None, uuid.UUID('11111111-1111-1111-1111-111111111111').bytes],
2690+
# 'uuid': [uuid.UUID('00000000-0000-0000-0000-000000000000').bytes, None, uuid.UUID('11111111-1111-1111-1111-111111111111').bytes], # noqa: E501
26912691
"binary": [b"\01", None, b"\22"],
26922692
"fixed": [
26932693
uuid.UUID("00000000-0000-0000-0000-000000000000").bytes,

tests/expressions/test_evaluator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1427,7 +1427,7 @@ def test_strict_integer_in(strict_data_file_schema: Schema, strict_data_file_1:
14271427

14281428

14291429
def test_strict_integer_not_in(strict_data_file_schema: Schema, strict_data_file_1: DataFile) -> None:
1430-
# should_read = _StrictMetricsEvaluator(strict_data_file_schema, NotIn("id", {INT_MIN_VALUE - 25, INT_MIN_VALUE - 24})).eval(strict_data_file_1)
1430+
# should_read = _StrictMetricsEvaluator(strict_data_file_schema, NotIn("id", {INT_MIN_VALUE - 25, INT_MIN_VALUE - 24})).eval(strict_data_file_1) # noqa: E501
14311431
# assert should_read, "Should match: all values != 5 and != 6"
14321432

14331433
should_read = _StrictMetricsEvaluator(strict_data_file_schema, NotIn("id", {INT_MIN_VALUE - 1, INT_MIN_VALUE})).eval(

tests/expressions/test_visitors.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,10 @@
9292

9393

9494
class ExampleVisitor(BooleanExpressionVisitor[list[str]]):
95-
"""A test implementation of a BooleanExpressionVisitor
95+
"""A test implementation of a BooleanExpressionVisitor.
9696
97-
As this visitor visits each node, it appends an element to a `visit_history` list. This enables testing that a given expression is
98-
visited in an expected order by the `visit` method.
97+
As this visitor visits each node, it appends an element to a `visit_history` list.
98+
This enables testing that a given expression is visited in an expected order by the `visit` method.
9999
"""
100100

101101
def __init__(self) -> None:
@@ -131,9 +131,10 @@ def visit_bound_predicate(self, predicate: BoundPredicate) -> list[str]:
131131

132132

133133
class FooBoundBooleanExpressionVisitor(BoundBooleanExpressionVisitor[list[str]]):
134-
"""A test implementation of a BoundBooleanExpressionVisitor
135-
As this visitor visits each node, it appends an element to a `visit_history` list. This enables testing that a given bound expression is
136-
visited in an expected order by the `visit` method.
134+
"""A test implementation of a BoundBooleanExpressionVisitor.
135+
136+
As this visitor visits each node, it appends an element to a `visit_history` list.
137+
This enables testing that a given bound expression is visited in an expected order by the `visit` method.
137138
"""
138139

139140
def __init__(self) -> None:
@@ -260,7 +261,7 @@ def test_bind_visitor_already_bound(table_schema_simple: Schema) -> None:
260261
with pytest.raises(TypeError) as exc_info:
261262
visit(bound, visitor=BindVisitor(schema=table_schema_simple, case_sensitive=True))
262263
assert (
263-
"Found already bound predicate: BoundEqualTo(term=BoundReference(field=NestedField(field_id=1, name='foo', field_type=StringType(), required=False), accessor=Accessor(position=0,inner=None)), literal=literal('hello'))"
264+
"Found already bound predicate: BoundEqualTo(term=BoundReference(field=NestedField(field_id=1, name='foo', field_type=StringType(), required=False), accessor=Accessor(position=0,inner=None)), literal=literal('hello'))" # noqa: E501
264265
== str(exc_info.value)
265266
)
266267

tests/integration/test_add_files.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ def test_add_files_to_bucket_partitioned_table_fails(spark: SparkSession, sessio
470470
with pytest.raises(ValueError) as exc_info:
471471
tbl.add_files(file_paths=file_paths)
472472
assert (
473-
"Cannot infer partition value from parquet metadata for a non-linear Partition Field: baz_bucket_3 with transform bucket[3]"
473+
"Cannot infer partition value from parquet metadata for a non-linear Partition Field: baz_bucket_3 with transform bucket[3]" # noqa: E501
474474
in str(exc_info.value)
475475
)
476476

@@ -518,7 +518,7 @@ def test_add_files_to_partitioned_table_fails_with_lower_and_upper_mismatch(
518518
with pytest.raises(ValueError) as exc_info:
519519
tbl.add_files(file_paths=file_paths)
520520
assert (
521-
"Cannot infer partition value from parquet metadata as there are more than one partition values for Partition Field: baz. lower_value=123, upper_value=124"
521+
"Cannot infer partition value from parquet metadata as there are more than one partition values for Partition Field: baz. lower_value=123, upper_value=124" # noqa: E501
522522
in str(exc_info.value)
523523
)
524524

@@ -754,7 +754,7 @@ def test_add_files_with_timestamp_tz_ns_fails(session_catalog: Catalog, format_v
754754
exception_cause = exc_info.value.__cause__
755755
assert isinstance(exception_cause, TypeError)
756756
assert (
757-
"Iceberg does not yet support 'ns' timestamp precision. Use 'downcast-ns-timestamp-to-us-on-write' configuration property to automatically downcast 'ns' to 'us' on write."
757+
"Iceberg does not yet support 'ns' timestamp precision. Use 'downcast-ns-timestamp-to-us-on-write' configuration property to automatically downcast 'ns' to 'us' on write." # noqa: E501
758758
in exception_cause.args[0]
759759
)
760760

tests/integration/test_inspect_table.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,11 +1096,13 @@ def test_inspect_files_format_version_3(spark: SparkSession, session_catalog: Ca
10961096
},
10971097
)
10981098

1099+
# fmt: off
10991100
insert_data_sql = f"""INSERT INTO {identifier} VALUES
11001101
(false, 'a', 'aaaaaaaaaaaaaaaaaaaaaa', 1, 1, 0.0, 0.0, TIMESTAMP('2023-01-01 19:25:00'), TIMESTAMP('2023-01-01 19:25:00+00:00'), DATE('2023-01-01'), X'01', X'00000000000000000000000000000000'),
11011102
(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
11021103
(true, 'z', 'zzzzzzzzzzzzzzzzzzzzzz', 9, 9, 0.9, 0.9, TIMESTAMP('2023-03-01 19:25:00'), TIMESTAMP('2023-03-01 19:25:00+00:00'), DATE('2023-03-01'), X'12', X'11111111111111111111111111111111');
11031104
"""
1105+
# fmt: on
11041106

11051107
spark.sql(insert_data_sql)
11061108
spark.sql(insert_data_sql)

0 commit comments

Comments
 (0)