94
94
from collections.abc import Collection
95
95
from typing import Any
96
96
97
- from pointblank._typing import AbsoluteBounds, Tolerance
97
+ from pointblank._typing import AbsoluteBounds, Tolerance, _CompliantValue, _CompliantValues
98
98
99
99
__all__ = [
100
100
"Validate",
@@ -12110,7 +12110,7 @@ def _process_action_str(
12110
12110
12111
12111
12112
12112
def _create_autobrief_or_failure_text(
12113
- assertion_type: str, lang: str, column: str | None , values: str | None, for_failure: bool
12113
+ assertion_type: str, lang: str, column: str, values: str | None, for_failure: bool
12114
12114
) -> str:
12115
12115
if assertion_type in [
12116
12116
"col_vals_gt",
@@ -12250,7 +12250,7 @@ def _expect_failure_type(for_failure: bool) -> str:
12250
12250
def _create_text_comparison(
12251
12251
assertion_type: str,
12252
12252
lang: str,
12253
- column: str | list[str] | None ,
12253
+ column: str | list[str],
12254
12254
values: str | None,
12255
12255
for_failure: bool = False,
12256
12256
) -> str:
@@ -12276,7 +12276,7 @@ def _create_text_comparison(
12276
12276
12277
12277
def _create_text_between(
12278
12278
lang: str,
12279
- column: str | None ,
12279
+ column: str,
12280
12280
value_1: str,
12281
12281
value_2: str,
12282
12282
not_: bool = False,
@@ -12306,7 +12306,7 @@ def _create_text_between(
12306
12306
12307
12307
12308
12308
def _create_text_set(
12309
- lang: str, column: str | None , values: list[any], not_: bool = False, for_failure: bool = False
12309
+ lang: str, column: str, values: list[any], not_: bool = False, for_failure: bool = False
12310
12310
) -> str:
12311
12311
type_ = _expect_failure_type(for_failure=for_failure)
12312
12312
@@ -12328,9 +12328,7 @@ def _create_text_set(
12328
12328
return text
12329
12329
12330
12330
12331
- def _create_text_null(
12332
- lang: str, column: str | None, not_: bool = False, for_failure: bool = False
12333
- ) -> str:
12331
+ def _create_text_null(lang: str, column: str, not_: bool = False, for_failure: bool = False) -> str:
12334
12332
type_ = _expect_failure_type(for_failure=for_failure)
12335
12333
12336
12334
column_text = _prep_column_text(column=column)
@@ -12347,9 +12345,7 @@ def _create_text_null(
12347
12345
return text
12348
12346
12349
12347
12350
- def _create_text_regex(
12351
- lang: str, column: str | None, pattern: str, for_failure: bool = False
12352
- ) -> str:
12348
+ def _create_text_regex(lang: str, column: str, pattern: str, for_failure: bool = False) -> str:
12353
12349
type_ = _expect_failure_type(for_failure=for_failure)
12354
12350
12355
12351
column_text = _prep_column_text(column=column)
@@ -12416,15 +12412,15 @@ def _create_text_rows_complete(
12416
12412
return text
12417
12413
12418
12414
12419
- def _create_text_row_count_match(lang: str, value: int , for_failure: bool = False) -> str:
12415
+ def _create_text_row_count_match(lang: str, value: dict , for_failure: bool = False) -> str:
12420
12416
type_ = _expect_failure_type(for_failure=for_failure)
12421
12417
12422
12418
values_text = _prep_values_text(value["count"], lang=lang)
12423
12419
12424
12420
return EXPECT_FAIL_TEXT[f"row_count_match_n_{type_}_text"][lang].format(values_text=values_text)
12425
12421
12426
12422
12427
- def _create_text_col_count_match(lang: str, value: int , for_failure: bool = False) -> str:
12423
+ def _create_text_col_count_match(lang: str, value: dict , for_failure: bool = False) -> str:
12428
12424
type_ = _expect_failure_type(for_failure=for_failure)
12429
12425
12430
12426
values_text = _prep_values_text(value["count"], lang=lang)
@@ -12447,19 +12443,13 @@ def _create_text_specially(lang: str, for_failure: bool = False) -> str:
12447
12443
def _prep_column_text(column: str | list[str]) -> str:
12448
12444
if isinstance(column, list):
12449
12445
return "`" + str(column[0]) + "`"
12450
- elif isinstance(column, str):
12446
+ if isinstance(column, str):
12451
12447
return "`" + column + "`"
12452
- else:
12453
- return ""
12448
+ raise AssertionError
12454
12449
12455
12450
12456
12451
def _prep_values_text(
12457
- values: str
12458
- | int
12459
- | float
12460
- | datetime.datetime
12461
- | datetime.date
12462
- | list[str | int | float | datetime.datetime | datetime.date],
12452
+ values: _CompliantValue | _CompliantValues,
12463
12453
lang: str,
12464
12454
limit: int = 3,
12465
12455
) -> str:
0 commit comments