99
99
from collections.abc import Collection
100
100
from typing import Any
101
101
102
- from pointblank._typing import AbsoluteBounds, Tolerance
102
+ from pointblank._typing import AbsoluteBounds, Tolerance, _CompliantValue, _CompliantValues
103
103
104
104
__all__ = [
105
105
"Validate",
@@ -13149,7 +13149,7 @@ def _process_action_str(
13149
13149
13150
13150
13151
13151
def _create_autobrief_or_failure_text(
13152
- assertion_type: str, lang: str, column: str | None , values: str | None, for_failure: bool
13152
+ assertion_type: str, lang: str, column: str, values: str | None, for_failure: bool
13153
13153
) -> str:
13154
13154
if assertion_type in [
13155
13155
"col_vals_gt",
@@ -13289,7 +13289,7 @@ def _expect_failure_type(for_failure: bool) -> str:
13289
13289
def _create_text_comparison(
13290
13290
assertion_type: str,
13291
13291
lang: str,
13292
- column: str | list[str] | None ,
13292
+ column: str | list[str],
13293
13293
values: str | None,
13294
13294
for_failure: bool = False,
13295
13295
) -> str:
@@ -13315,7 +13315,7 @@ def _create_text_comparison(
13315
13315
13316
13316
def _create_text_between(
13317
13317
lang: str,
13318
- column: str | None ,
13318
+ column: str,
13319
13319
value_1: str,
13320
13320
value_2: str,
13321
13321
not_: bool = False,
@@ -13345,7 +13345,7 @@ def _create_text_between(
13345
13345
13346
13346
13347
13347
def _create_text_set(
13348
- lang: str, column: str | None , values: list[any], not_: bool = False, for_failure: bool = False
13348
+ lang: str, column: str, values: list[any], not_: bool = False, for_failure: bool = False
13349
13349
) -> str:
13350
13350
type_ = _expect_failure_type(for_failure=for_failure)
13351
13351
@@ -13367,9 +13367,7 @@ def _create_text_set(
13367
13367
return text
13368
13368
13369
13369
13370
- def _create_text_null(
13371
- lang: str, column: str | None, not_: bool = False, for_failure: bool = False
13372
- ) -> str:
13370
+ def _create_text_null(lang: str, column: str, not_: bool = False, for_failure: bool = False) -> str:
13373
13371
type_ = _expect_failure_type(for_failure=for_failure)
13374
13372
13375
13373
column_text = _prep_column_text(column=column)
@@ -13386,9 +13384,7 @@ def _create_text_null(
13386
13384
return text
13387
13385
13388
13386
13389
- def _create_text_regex(
13390
- lang: str, column: str | None, pattern: str, for_failure: bool = False
13391
- ) -> str:
13387
+ def _create_text_regex(lang: str, column: str, pattern: str, for_failure: bool = False) -> str:
13392
13388
type_ = _expect_failure_type(for_failure=for_failure)
13393
13389
13394
13390
column_text = _prep_column_text(column=column)
@@ -13455,15 +13451,15 @@ def _create_text_rows_complete(
13455
13451
return text
13456
13452
13457
13453
13458
- def _create_text_row_count_match(lang: str, value: int , for_failure: bool = False) -> str:
13454
+ def _create_text_row_count_match(lang: str, value: dict , for_failure: bool = False) -> str:
13459
13455
type_ = _expect_failure_type(for_failure=for_failure)
13460
13456
13461
13457
values_text = _prep_values_text(value["count"], lang=lang)
13462
13458
13463
13459
return EXPECT_FAIL_TEXT[f"row_count_match_n_{type_}_text"][lang].format(values_text=values_text)
13464
13460
13465
13461
13466
- def _create_text_col_count_match(lang: str, value: int , for_failure: bool = False) -> str:
13462
+ def _create_text_col_count_match(lang: str, value: dict , for_failure: bool = False) -> str:
13467
13463
type_ = _expect_failure_type(for_failure=for_failure)
13468
13464
13469
13465
values_text = _prep_values_text(value["count"], lang=lang)
@@ -13486,19 +13482,13 @@ def _create_text_specially(lang: str, for_failure: bool = False) -> str:
13486
13482
def _prep_column_text(column: str | list[str]) -> str:
13487
13483
if isinstance(column, list):
13488
13484
return "`" + str(column[0]) + "`"
13489
- elif isinstance(column, str):
13485
+ if isinstance(column, str):
13490
13486
return "`" + column + "`"
13491
- else:
13492
- return ""
13487
+ raise AssertionError
13493
13488
13494
13489
13495
13490
def _prep_values_text(
13496
- values: str
13497
- | int
13498
- | float
13499
- | datetime.datetime
13500
- | datetime.date
13501
- | list[str | int | float | datetime.datetime | datetime.date],
13491
+ values: _CompliantValue | _CompliantValues,
13502
13492
lang: str,
13503
13493
limit: int = 3,
13504
13494
) -> str:
0 commit comments