Skip to content

Conversation

@borchero
Copy link
Member

Motivation

#185 -- there's no good reason not to support this properly.

Changes

  • Make @dy.rule() apply to classmethods, i.e. methods that receive cls
    • This makes the mypy plugin superfluous (nice!) but requires setting
      [tool.ruff.lint.pep8-naming]
      classmethod-decorators = ["dataframely.rule"]
    • We could get rid of this by simply naming the receiver self but this feels wrong (since the method is never actually called on an instance). Please challenge if you think differently though.

Apart from this change, all other methods are backwards-compatible.

@codecov
Copy link

codecov bot commented Oct 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (9fc131f) to head (851f1f3).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #198   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           53        53           
  Lines         2991      3005   +14     
=========================================
+ Hits          2991      3005   +14     

☔ 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.

Copy link
Member

@delsner delsner left a comment

Choose a reason for hiding this comment

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

Thanks! I think the ruff rule is fine. Should we document this a bit more prominent than in the migration docs? (Sorry, if I missed it.) Also, we could think about changing some examples to use cls.<column>.col now. Wdyt?

@borchero
Copy link
Member Author

Should we document this a bit more prominent than in the migration docs?

Should be in there already 😄

@borchero borchero enabled auto-merge (squash) October 27, 2025 17:28
@borchero borchero merged commit 17aa1a5 into main Oct 27, 2025
31 checks passed
@borchero borchero deleted the rule-cls branch October 27, 2025 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants