Skip to content

Fix #77: rename_arguments double-partial bug#78

Merged
hmgaudecker merged 3 commits intomainfrom
fix-77
Mar 13, 2026
Merged

Fix #77: rename_arguments double-partial bug#78
hmgaudecker merged 3 commits intomainfrom
fix-77

Conversation

@hmgaudecker
Copy link
Member

Summary

  • Fix rename_arguments wrapping partial inputs in a second functools.partial, which caused bound arguments to be passed twice
  • Use get_free_arguments to filter the wrapper's signature to only truly free parameters, instead of re-implementing partial keyword detection
  • Add 6 tests covering rename_arguments with functools.partial inputs

Details

The old code had a "Preserve function type" block that wrapped the closure in functools.partial(wrapper, *func.args, **func.keywords). This re-bound arguments that were already captured by the closure's call to func(...), causing double-passing.

The fix removes that block and instead filters keyword-bound parameters out of the wrapper's signature using the existing get_free_arguments helper, keeping a single source of truth for which parameters are free.

Test plan

  • All 175 dags tests pass
  • Downstream: gettsim — 2470 passed (1 unrelated failure: missing SOEP data file)
  • Downstream: pylcm — 726 passed
  • Downstream: skillmodels — 351 passed

Closes #77

🤖 Generated with Claude Code

@codecov
Copy link

codecov bot commented Mar 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.70%. Comparing base (ca4c296) to head (68b07b3).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #78      +/-   ##
==========================================
+ Coverage   96.61%   96.70%   +0.08%     
==========================================
  Files          26       26              
  Lines        1272     1306      +34     
==========================================
+ Hits         1229     1263      +34     
  Misses         43       43              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Member Author

@hmgaudecker hmgaudecker left a comment

Choose a reason for hiding this comment

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

Autoreview.

@hmgaudecker hmgaudecker requested a review from timmens March 13, 2026 06:46

## 0.5.0

- :gh:`77` Fix `decorator_rename_arguments` by calling `get_free_arguments` inside the
Copy link
Member Author

Choose a reason for hiding this comment

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

Messed up in multiple ways; fixed in #79

@hmgaudecker hmgaudecker merged commit 834712d into main Mar 13, 2026
22 checks passed
@hmgaudecker hmgaudecker deleted the fix-77 branch March 13, 2026 09:31
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.

rename_arguments creates double-partial when input is functools.partial

2 participants