Skip to content

fix: allow empty string as password - #825

Merged
Hugovdberg merged 8 commits into
developfrom
Hugovdberg-patch-1
Sep 28, 2026
Merged

Hugovdberg merged 8 commits into
developfrom
Hugovdberg-patch-1

Conversation

@Hugovdberg

Copy link
Copy Markdown
Owner

fixes #824

Copilot AI lite review requested due to automatic review settings September 25, 2026 13:22

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Unresolved critical and moderate issues affect test execution, credential handling, generic typing, and CI enforcement.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity · 1 Medium severity · 1 Low severity

Open (3)
What changed in this PR

This pull request allows empty-string passwords and modernizes typing, tooling, and test fakes.

Changes:

  • Distinguishes None credentials from empty passwords.
  • Adds and refines SDK type stubs and annotations.
  • Updates Pixi type-checking configuration and fake collections.
File Summary
tests/​test_PIAF.py Removes an obsolete type ignore.
tests/​fakes.py Updates fake attribute collections; critical issue remains with FakeKeyValue iteration causing a TypeError (3 votes).
pyproject.toml Adds type-checking configuration; moderate issue: ty_check is not gated by CI (2 votes).
PIconnect/​Time.py Adds explicit type aliases.
PIconnect/​Search.py Clarifies loop variable naming.
PIconnect/​PI.py Supports empty passwords; moderate issue with empty usernames bypassing supplied credentials (1 vote), plus a regression-test nit (4 votes).
PIconnect/​dotnet.py Improves SDK loading typing and errors.
PIconnect/​Data.py Refines pandas typing.
PIconnect/​Asset.py Clarifies optional PI point returns.
PIconnect/​AF.py Refines context-manager typing.
PIconnect/​_version.py Excludes generated version code from type-checking errors.
PIconnect/​_typing/​System/​Collections/​Generic.py Adds generic collection protocols; moderate variance issue requires invariant type variables (1 vote).
PIconnect/​_typing/​System/​Collections/​__init__.py Exports generic collection types.
PIconnect/​_typing/​System/​__init__.py Exposes collection mocks.
PIconnect/​_typing/​AF/​PI.py Adds explicit missing-value return typing.
PIconnect/​_typing/​AF/​EventFrame.py Uses Self for parent typing.
PIconnect/​_typing/​AF/​Asset.py Uses Self for parent typing.
PIconnect/​_typing/​AF/​_values.py Adds initializer return typing.
PIconnect/​_typing/​AF/​__init__.py Refines mock optionality.
PIconnect/​_typing/​__init__.py Adds typing suppressions and protocol refinements.
PIconnect/​_collections.py Removes obsolete type ignores.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread tests/fakes.py
Comment on lines +85 to +87
self.attributes = Generic_.PropertyDict(
[FakeKeyValue(*att) for att in attributes.items()]
)
Comment thread pyproject.toml
Comment on lines +60 to 61
ty_check = "ty check ."
format = { cmd = "ruff format --check .", depends-on = ["lint"] }
Comment thread PIconnect/PI.py
tuple[dotnet.System.Net.NetworkCredential, dotnet.AF.PI.PIAuthenticationMode]
| None
)
if (username is not None) != (password is not None):
@Hugovdberg
Hugovdberg merged commit f926131 into develop Sep 28, 2026
4 checks passed
@Hugovdberg
Hugovdberg deleted the Hugovdberg-patch-1 branch September 28, 2026 09:13
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.

Authentication with Empty Password (empty string)

3 participants