| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
@microsoft-github-policy-service agree |
Sorry, something went wrong.
There was a problem hiding this comment.
Thanks for the focused change—the sentinel-based recursion preserves the existing skip behavior cleanly, and the nested protocol regression coverage exercises the original failure well.
One compatibility edge is worth confirming or pinning with tests: moving the (datetime, date, time) branch into the shared helper expands conversion beyond dictionary values. Top-level date/time attributes and date/time values inside lists were previously skipped as non-serializable, but are now emitted as strings. That may be a desirable consistency fix, but it is an observable behavior change beyond nested protocol serialization. Could you either confirm it is intentional and add coverage for those locations, or restrict the conversion to the prior dictionary-value context?
Sorry, something went wrong.
|
Esan (@EsanRAHIMI) You are right; the broader date/time conversion was not intentional. Addressed in 60d9e33 by moving (datetime, date, time) conversion back into the dictionary-value branch. Top-level date/time attributes and date/time list items are skipped as before, while dictionary values still serialize to strings and the nested protocol recursion remains intact. The regression test now covers all three date/time types in top-level, list-item, and dictionary-value locations. The 485 serialization/session/type tests, Ruff, source Pyright, and test Pyright all pass. |
Sorry, something went wrong.
There was a problem hiding this comment.
The follow-up restores the previous date/time serialization boundary while keeping the nested container recursion intact. The regression test now covers datetime, date, and time across top-level attributes, list items, and dictionary values. This addresses my compatibility concern—thanks!
Sorry, something went wrong.
|
Evan Mattson (@moonbox3) The follow-up in 8f3b8be addresses both remaining compatibility concerns: nested non-string dictionary keys retain the previous to_dict()/to_json() behavior, and recursive list/dictionary cycles now raise the controlled ValueError while repeated acyclic references remain supported. Regression tests cover both paths, and all 507 relevant tests plus Ruff and Pyright pass locally. A fresh review of the latest commit would be appreciated when convenient. |
Sorry, something went wrong.
Python Test Coverage Report •
Python Unit Test Overview
|
||||||||||||||||||||||||||||||
Sorry, something went wrong.
|
Thanks for the suggestion! _SKIP_SERIALIZATION is already defined as a module-level object() sentinel, and all checks use identity comparison with is. If you meant a named sentinel type or a different project convention, I’m happy to adjust it. |
Sorry, something went wrong.
|
Thanks for the clarification. Updated _SKIP_SERIALIZATION to use the project-standard typing_extensions.Sentinel("SKIP_SERIALIZATION") with a Final annotation, while keeping the existing identity checks and behavior unchanged. The focused serialization tests (39 tests) and Ruff check/format pass locally. The full dependency Pyright run is currently blocked by unrelated missing optional modules in this checkout. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Motivation & Context
SerializationMixin.to_dict() handled protocol objects only when they were direct list items or dictionary values. Protocol objects inside combinations such as dict -> list -> dict remained as Python objects, causing the corresponding to_json() call to fail with TypeError.
Description & Review Guide
Related Issue
Fixes #7788
Contribution Checklist