Skip to content

💥 boom: replace DataclassInstance with optype.HasDataclassFields#78

Merged
nstarman merged 2 commits into
GalacticDynamics:mainfrom
nstarman:optype-followup
Mar 14, 2026
Merged

💥 boom: replace DataclassInstance with optype.HasDataclassFields#78
nstarman merged 2 commits into
GalacticDynamics:mainfrom
nstarman:optype-followup

Conversation

@nstarman

@nstarman nstarman commented Feb 22, 2026

Copy link
Copy Markdown
Contributor

Further simplification.

@nstarman nstarman added this to the v0.9.0 milestone Feb 22, 2026
Copilot AI review requested due to automatic review settings February 22, 2026 18:15
@github-actions github-actions Bot added the 💥 Introduce breaking changes Introduce breaking changes. label Feb 22, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes the project’s custom DataclassInstance protocol and switches dataclass-related dispatch/type annotations to use optype.dataclasses.HasDataclassFields instead.

Changes:

  • Removed DataclassInstance from dataclassish._src.types and from the top-level dataclassish exports.
  • Updated dataclass dispatch registrations (get_field, replace, fields, asdict, astuple) to accept opt.dataclasses.HasDataclassFields.
  • Adjusted a converters module docstring to no longer mention DataclassInstance.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/dataclassish/_src/types.py Deletes the DataclassInstance protocol and updates __all__ accordingly.
src/dataclassish/_src/register_dataclass.py Replaces DataclassInstance annotations with opt.dataclasses.HasDataclassFields for dispatch signatures.
src/dataclassish/_src/converters.py Docstring wording update referencing “Dataclass instance” instead of DataclassInstance.
src/dataclassish/init.py Removes DataclassInstance from the public package exports/imports.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/dataclassish/_src/types.py
Comment thread src/dataclassish/__init__.py
@nstarman nstarman changed the title 💥 boom: replace DataclassInstance with opt.dataclasses.HasDataclassFi… 💥 boom: replace DataclassInstance with optype.HasDataclassFields Feb 22, 2026
…elds

Signed-off-by: nstarman <nstarman@users.noreply.github.com>
@github-actions github-actions Bot added 🔧 Add / update configuration Add or update configuration files. ⬆️ Upgrade dependencies Upgrade dependencies. labels Mar 14, 2026
@nstarman
nstarman merged commit 45adbe2 into GalacticDynamics:main Mar 14, 2026
18 checks passed
@nstarman
nstarman deleted the optype-followup branch March 14, 2026 03:30
@codecov

codecov Bot commented Mar 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.26%. Comparing base (841444a) to head (fadf8dd).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #78      +/-   ##
==========================================
- Coverage   97.32%   97.26%   -0.06%     
==========================================
  Files          12       12              
  Lines         299      293       -6     
==========================================
- Hits          291      285       -6     
  Misses          8        8              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔧 Add / update configuration Add or update configuration files. 💥 Introduce breaking changes Introduce breaking changes. ⬆️ Upgrade dependencies Upgrade dependencies.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants