Skip to content

Fix a bug in pipeweld for inserting into parallel steps with empty …#1419

Merged
nathanjmcdougall merged 4 commits into
mainfrom
1331-enable-reportunknownlambdatype-in-basedpyright
Mar 13, 2026
Merged

Fix a bug in pipeweld for inserting into parallel steps with empty …#1419
nathanjmcdougall merged 4 commits into
mainfrom
1331-enable-reportunknownlambdatype-in-basedpyright

Conversation

@nathanjmcdougall

Copy link
Copy Markdown
Collaborator

…series

Enable reportUnknownLambdaType in basedpyright

…series

Enable `reportUnknownLambdaType` in `basedpyright`
@codspeed-hq

codspeed-hq Bot commented Mar 13, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 2 untouched benchmarks


Comparing 1331-enable-reportunknownlambdatype-in-basedpyright (6dcf59c) with main (c00d2f0)

Open in CodSpeed

@codecov

codecov Bot commented Mar 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

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

Fixes pipeweld insertion behavior for parallel blocks when a branch has an empty Series, and tightens typing to support enabling basedpyright’s reportUnknownLambdaType.

Changes:

  • Add regression test covering Parallel insertion when a branch is an empty Series().
  • Update _get_instructions_for_insertion() to handle None endpoints and avoid min(endpoints) failures.
  • Adjust type annotations and basedpyright configuration to enable reportUnknownLambdaType (with a tests-only override).

Reviewed changes

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

File Description
tests/usethis/_integrations/ci/bitbucket/test_pipeweld.py Adds regression test for parallel insertion with an empty series branch.
src/usethis/_pipeweld/func.py Updates parallel insertion logic to tolerate None endpoints and preserve instruction grouping.
src/usethis/_tool/impl/base/import_linter.py Adds more precise local types to satisfy stricter type checking around lambdas/config dicts.
pyproject.toml Enables reportUnknownLambdaType globally, while suppressing it for the tests execution environment.

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

You can also share your feedback on Copilot code review. Take the survey.

Comment thread src/usethis/_pipeweld/func.py
Comment thread src/usethis/_pipeweld/func.py

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

Fixes pipeweld insertion behavior when inserting into Parallel components that include empty Series branches, and tightens static typing after enabling reportUnknownLambdaType in basedpyright.

Changes:

  • Add regression tests covering Parallel insertion with empty and multi-step Series branches.
  • Update _get_instructions_for_insertion to handle None endpoints during Parallel insertion and preserve deterministic instruction ordering.
  • Enable reportUnknownLambdaType for non-test code and add missing type annotations in ImportLinterTool.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
tests/usethis/_integrations/ci/bitbucket/test_pipeweld.py Adds tests for Parallel insertion edge cases involving empty/multi-step Series.
src/usethis/_tool/impl/base/import_linter.py Adds type annotations to satisfy stricter basedpyright settings.
src/usethis/_pipeweld/func.py Fixes Parallel insertion logic when some branches yield None endpoints and adjusts ordering.
pyproject.toml Enables reportUnknownLambdaType outside tests while keeping it disabled for the tests execution environment.

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

You can also share your feedback on Copilot code review. Take the survey.

Comment thread src/usethis/_pipeweld/func.py
@nathanjmcdougall nathanjmcdougall merged commit 889eb18 into main Mar 13, 2026
20 checks passed
@nathanjmcdougall nathanjmcdougall deleted the 1331-enable-reportunknownlambdatype-in-basedpyright branch March 13, 2026 20:22
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.

enable reportUnknownLambdaType in basedpyright

2 participants