Part of #12128.
What to do
Bring the six excluded modules under tests/core/ into the type-check: fix the 178 errors
mypy reports there, then remove the six covering exclude patterns from pyproject.toml and
regenerate the relaxation inventory in the same change.
Fix each error by correcting the test against the library's current contract, never by
silencing it. A call written f(**{...}) is checked as one argument against the first
parameter, which turns a whole literal into one useless diagnostic per candidate parameter;
written as direct keyword arguments it is checked argument by argument. That transform — same
argument order, byte-identical value expressions — is most of this issue.
Where
tests/core/test_batch.py — 122 errors, 85 of them one **dict splat into
get_batch_request_from_acceptable_arguments across 17 call sites.
tests/core/test_expectation_validation_result.py — 43 errors, 42 the same splat shape into
the ExpectationValidationResult constructor. The 43rd is at line 328: a fixture built as
ExpectationSuiteValidationResultMeta(...) that omits batch_parameters, checkpoint_id
and validation_id, so it does not match the TypedDict it claims to instantiate.
test_expectation_suite.py (5), test_validation_definition.py (4),
test_expectation_configuration.py (2), test_yaml_handler.py (2).
pyproject.toml — remove the six exclude entries naming tests/core/….
scripts/mypy_relaxation_inventory.json — regenerate with the guard's emit mode, never by hand.
How to verify
pip install -r requirements-types.txt -r reqs/requirements-dev-contrib.txt
# remove the six tests/core/ lines from the exclude list in pyproject.toml, then:
python scripts/mypy_config_guard.py --emit-inventory > scripts/mypy_relaxation_inventory.json
invoke type-check --ci --pretty
pytest tests/core/
Before: 178 errors in six files; 783 source files checked (at 2c4123fa9).
After: zero errors; 789 checked; pytest tests/core/ passing as it does today.
Requirements
- When the type-check runs on the merged change, it reports zero errors and no
exclude
pattern naming a path under tests/core/ remains.
- Completing the fixture at line 328 must not change what its test observes. If supplying the
three missing keys makes the test fail, that is evidence about the library — comment here
rather than adjusting the test until it passes.
- No test may be weakened: no assertion deleted or made vacuous, no expected value loosened,
no Any or cast hiding a real mismatch, no new skip or xfail.
pytest tests/core/ must pass with the same outcomes as before.
- The inventory must be regenerated by
python scripts/mypy_config_guard.py --emit-inventory
in the same change, and the guard must pass.
- No file under
great_expectations/ may change, and no test function signature may gain
annotations. If the correct fix looks like it lies in library code, comment here instead.
Out of scope: every exclude pattern outside tests/core/; the follow_imports = 'silent'
override block; any mypy strictness flag; annotations on test function signatures.
Notes
- Do the two splat clusters first: they are 127 of the 178 errors and collapse fast, leaving a
short tail of genuine stale-signature fixes.
Part of #12128.
What to do
Bring the six excluded modules under
tests/core/into the type-check: fix the 178 errorsmypy reports there, then remove the six covering
excludepatterns frompyproject.tomlandregenerate the relaxation inventory in the same change.
Fix each error by correcting the test against the library's current contract, never by
silencing it. A call written
f(**{...})is checked as one argument against the firstparameter, which turns a whole literal into one useless diagnostic per candidate parameter;
written as direct keyword arguments it is checked argument by argument. That transform — same
argument order, byte-identical value expressions — is most of this issue.
Where
tests/core/test_batch.py— 122 errors, 85 of them one**dictsplat intoget_batch_request_from_acceptable_argumentsacross 17 call sites.tests/core/test_expectation_validation_result.py— 43 errors, 42 the same splat shape intothe
ExpectationValidationResultconstructor. The 43rd is at line 328: a fixture built asExpectationSuiteValidationResultMeta(...)that omitsbatch_parameters,checkpoint_idand
validation_id, so it does not match theTypedDictit claims to instantiate.test_expectation_suite.py(5),test_validation_definition.py(4),test_expectation_configuration.py(2),test_yaml_handler.py(2).pyproject.toml— remove the sixexcludeentries namingtests/core/….scripts/mypy_relaxation_inventory.json— regenerate with the guard's emit mode, never by hand.How to verify
Before: 178 errors in six files; 783 source files checked (at
2c4123fa9).After: zero errors; 789 checked;
pytest tests/core/passing as it does today.Requirements
excludepattern naming a path under
tests/core/remains.three missing keys makes the test fail, that is evidence about the library — comment here
rather than adjusting the test until it passes.
no
Anyorcasthiding a real mismatch, no newskiporxfail.pytest tests/core/must pass with the same outcomes as before.python scripts/mypy_config_guard.py --emit-inventoryin the same change, and the guard must pass.
great_expectations/may change, and no test function signature may gainannotations. If the correct fix looks like it lies in library code, comment here instead.
Out of scope: every
excludepattern outsidetests/core/; thefollow_imports = 'silent'override block; any mypy strictness flag; annotations on test function signatures.
Notes
short tail of genuine stale-signature fixes.