Skip to content

Allow None in write type annotations for zero-length write requests - #525

Merged
stlehmann merged 1 commit into
stlehmann:masterfrom
chrisbeardy:claude/pyads-pr515-type-annotation-OEBbi
May 31, 2026
Merged

stlehmann merged 1 commit into
stlehmann:masterfrom
chrisbeardy:claude/pyads-pr515-type-annotation-OEBbi

Conversation

@chrisbeardy

Copy link
Copy Markdown
Collaborator

Human Note: AI generated but seems to check out

PR #515 added support for zero-length write requests (plc_data_type=None) in adsSyncWriteReqEx but did not update the type annotations to reflect that None is now an accepted value. Update the annotations on adsSyncWriteReqEx and Connection.write to Optional[Type], and add a test covering the zero-length write use-case.

https://claude.ai/code/session_01QKx2yv6cnjKgJAeHkU6JEG

PR stlehmann#515 added support for zero-length write requests (plc_data_type=None)
in adsSyncWriteReqEx but did not update the type annotations to reflect that
None is now an accepted value. Update the annotations on adsSyncWriteReqEx
and Connection.write to Optional[Type], and add a test covering the
zero-length write use-case.

https://claude.ai/code/session_01QKx2yv6cnjKgJAeHkU6JEG

@stlehmann stlehmann left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Nice and clean PR. @chrisbeardy which agent did you use for this?

@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 26707349297

Coverage increased (+0.2%) to 93.424%

Details

  • Coverage increased (+0.2%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 90 coverage regressions across 12 files.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

90 previously-covered lines in 12 files lost coverage.

Top 10 Files by Coverage Loss Lines Losing Coverage Coverage
/opt/hostedtoolcache/Python/3.10.20/x64/lib/python3.10/site-packages/pyads/pyads_ex.py 14 90.98%
/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/pyads/pyads_ex.py 14 90.98%
/opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages/pyads/pyads_ex.py 14 90.98%
/opt/hostedtoolcache/Python/3.13.13/x64/lib/python3.13/site-packages/pyads/pyads_ex.py 14 90.98%
/opt/hostedtoolcache/Python/3.14.5/x64/lib/python3.14/site-packages/pyads/pyads_ex.py 14 90.98%
/opt/hostedtoolcache/Python/3.9.25/x64/lib/python3.9/site-packages/pyads/pyads_ex.py 14 90.98%
/opt/hostedtoolcache/Python/3.10.20/x64/lib/python3.10/site-packages/pyads/connection.py 1 97.22%
/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/pyads/connection.py 1 97.22%
/opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages/pyads/connection.py 1 97.22%
/opt/hostedtoolcache/Python/3.13.13/x64/lib/python3.13/site-packages/pyads/connection.py 1 97.22%

Coverage Stats

Coverage Status
Relevant Lines: 11496
Covered Lines: 10740
Line Coverage: 93.42%
Coverage Strength: 1.09 hits per line

💛 - Coveralls

@stlehmann
stlehmann merged commit d4d0e62 into stlehmann:master May 31, 2026
17 of 22 checks passed
@chrisbeardy

Copy link
Copy Markdown
Collaborator Author

Nice and clean PR. @chrisbeardy which agent did you use for this?

All done from the comfort of my sofa using Claude code from the phone app. Remarkable. I use Claude Code extensively at work now and given the right amount of oversight its a powerful tool. I should probably let it have a go more on pyads, especially on existing problems and review.

stlehmann added a commit that referenced this pull request Jun 16, 2026
- RISC-V wheel support (#520)
- None type annotation for zero-length writes (#525)
- Fix segfault on interpreter shutdown (#524)
- Fix macOS wheel build (#533)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

4 participants