Fix Python model for Local API (id = None)#1974
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes incorrect Setup.id initialization when the Local API omits the id field, preventing attrs internal _CountingAttr objects from leaking into model instances and JSON-like output.
Changes:
- Update
Setup.idtyping andSetup.__init__default to correctly supportNonewhenidis missing. - Add/extend tests to assert
setup.id is Nonefor local setup fixtures and validate obfuscatedreprwhenidis present. - Update local connection docs to include the typical
:8443port in the hostname example.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
pyoverkiz/models.py |
Fix Setup.id type/default handling so missing id stays None instead of an attrs sentinel object. |
tests/test_models.py |
Add unit tests for setup id parsing and repr redaction behavior using fixtures. |
tests/test_client.py |
Assert setup.id is None for local setup fixtures in client.get_setup() tests. |
docs/getting-started.md |
Adjust local server example to include :8443 in the host string. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
tetienne
approved these changes
Apr 6, 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.
Fixes #1183