Fix a bug in pipeweld for inserting into parallel steps with empty …#1419
Conversation
…series Enable `reportUnknownLambdaType` in `basedpyright`
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
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
Parallelinsertion when a branch is an emptySeries(). - Update
_get_instructions_for_insertion()to handleNoneendpoints and avoidmin(endpoints)failures. - Adjust type annotations and
basedpyrightconfiguration to enablereportUnknownLambdaType(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.
There was a problem hiding this comment.
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
Parallelinsertion with empty and multi-stepSeriesbranches. - Update
_get_instructions_for_insertionto handleNoneendpoints duringParallelinsertion and preserve deterministic instruction ordering. - Enable
reportUnknownLambdaTypefor non-test code and add missing type annotations inImportLinterTool.
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.
…series
Enable
reportUnknownLambdaTypeinbasedpyright