Repository navigation
Conversation
shi-felix
requested review from
MRZHUH,
QuantumGhost,
laipz8200 and
snakevash
as code owners
October 27, 2026 10:02
Contributor
Pyrefly Diffbase → PR--- /tmp/pyrefly_base.txt 2026-11-03 02:31:32.446905941 +0000
+++ /tmp/pyrefly_pr.txt 2026-11-03 02:31:20.298744490 +0000
@@ -5658,18 +5658,6 @@
--> tests/unit_tests/extensions/test_ext_celery.py:103:18
ERROR Argument `Literal['browser']` is not assignable to parameter `type` with type `EndUserType | SQLCoreOperations[EndUserType]` in function `models.model.EndUser.__init__` [bad-argument-type]
--> tests/unit_tests/extensions/test_ext_login.py:53:14
-ERROR Argument `list[FromClause]` is not assignable to parameter `tables` with type `Sequence[Table] | None` in function `sqlalchemy.sql.schema.MetaData.create_all` [bad-argument-type]
- --> tests/unit_tests/factories/file_factory/test_builders.py:85:58
-ERROR Object of class `NoneType` has no attribute `storage_key` [missing-attribute]
- --> tests/unit_tests/factories/file_factory/test_builders.py:164:12
-ERROR Object of class `NoneType` has no attribute `storage_key` [missing-attribute]
- --> tests/unit_tests/factories/file_factory/test_builders.py:196:12
-ERROR Object of class `Dataset` has no attribute `embedding_available` [missing-attribute]
- --> tests/unit_tests/fields/test_dataset_fields.py:228:5
-ERROR Argument `str` is not assignable to parameter `indexing_status` with type `IndexingStatus | SQLCoreOperations[IndexingStatus]` in function `models.dataset.Document.__init__` [bad-argument-type]
- --> tests/unit_tests/fields/test_dataset_fields.py:299:25
-ERROR Cannot set item in `OrderedDict[str, bool | list[str] | str]` [unsupported-operation]
- --> tests/unit_tests/fields/test_workflow_draft_variable_fields.py:142:47
ERROR Object of class `Subscription` has no attribute `_start_if_needed` [missing-attribute]
--> tests/unit_tests/libs/broadcast_channel/redis/test_pubsub_channel.py:152:13
ERROR Object of class `Subscription` has no attribute `_start_if_needed` [missing-attribute]
|
Contributor
Pyrefly Type Coverage
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #44881 +/- ##
========================================
Coverage 89.77% 89.77%
========================================
Files 6238 6238
Lines 390615 390848 +233
Branches 79229 79264 +35
========================================
+ Hits 350671 350883 +212
- Misses 33851 33865 +14
- Partials 6093 6100 +7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
asukaminato0721
enabled auto-merge
October 28, 2026 08:04
Drop the six exclude entries so strict pyrefly checks these modules.
auto-merge was automatically disabled
October 30, 2026 03:30
Head branch was pushed to by a user without write access
shi-felix
force-pushed
the
refactor/pyrefly-strict-test-batch-11
branch
from
October 30, 2026 03:30
3a9a83d to
a37e0ee
Compare
Contributor
Author
|
Rebased onto |
The strict-typing cleanup introduced three `typing.cast` calls that the `check_no_new_cast` guard rejects. Narrow the dumped payload with `assert isinstance(...)` instead, and drop the duplicated assignment that re-read `retrieval_model_dict` in the same test.
| @@ -82,7 +94,11 @@ class FileRecords: | |||
| @pytest.fixture(autouse=True) | |||
| def file_records(monkeypatch: pytest.MonkeyPatch, sqlite_engine: Engine) -> Iterator[FileRecords]: | |||
asukaminato0721
requested changes
Nov 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Enable strict pyrefly checking for 7 test files under
tests/unit_tests/fields/,tests/unit_tests/factories/, andtests/unit_tests/migrations/by removing them from the strict-mode exclusion list and fixing the resulting diagnostics:FileMappingInput,FileUploadConfig,FileType,IndexingStatus,MagicMock,Iterator/Generatorreturns).test_message_fields.pyviamodel_validate(the suite base model setsvalidate_by_name=True, so behavior is unchanged) instead of unpacking a loosely typed kwargs dict.parse_file_reference,importlib.util.spec_from_file_location) and annotate nestedfake_standardize/_fake_headclosures to mirror the patched callables.__table__stub mismatch oncreate_all(tables=...), a deliberate dynamic attribute on a decoyDataset, and raw stored dicts re-validated through pydantic.Verification
pyrefly checkwith the unit-test strict config: 0 diagnostics for all 7 files.ruff format+ruff check: clean.scripts/check_no_new_test_doubles.py --base-rev main: no new test doubles.pytest: 137 passed acrossfields/test_message_fields.py(8),fields/test_dataset_fields.py(7),factories/file_factory/test_builders.py(52),factories/file_factory/test_remote.py(42),factories/file_factory/test_validation.py(17), and the uuidv7 migration test (11).fields/test_workflow_draft_variable_fields.pycannot be collected in this local Windows sandbox (the conftest chain hangs on import, same astests/unit_tests/events/andtasks/), so that file relies on CI.