Skip to content

Fix Python model for Local API (id = None)#1974

Merged
iMicknl merged 3 commits intov2/mainfrom
v2/fix_id_local_api
Apr 6, 2026
Merged

Fix Python model for Local API (id = None)#1974
iMicknl merged 3 commits intov2/mainfrom
v2/fix_id_local_api

Conversation

@iMicknl
Copy link
Copy Markdown
Owner

@iMicknl iMicknl commented Apr 6, 2026

Fixes #1183

@iMicknl iMicknl requested a review from tetienne as a code owner April 6, 2026 18:17
Copilot AI review requested due to automatic review settings April 6, 2026 18:17
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.id typing and Setup.__init__ default to correctly support None when id is missing.
  • Add/extend tests to assert setup.id is None for local setup fixtures and validate obfuscated repr when id is present.
  • Update local connection docs to include the typical :8443 port 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.

@iMicknl iMicknl mentioned this pull request Apr 6, 2026
@iMicknl iMicknl merged commit 137563c into v2/main Apr 6, 2026
8 checks passed
@iMicknl iMicknl deleted the v2/fix_id_local_api branch April 6, 2026 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants