Skip to content

[MNT] Improve error message for invalid reduction argument in groupby_apply#2104

Merged
phoeenniixx merged 2 commits intosktime:mainfrom
Gyanam1310:improve-groupby-apply-error-message
Mar 4, 2026
Merged

[MNT] Improve error message for invalid reduction argument in groupby_apply#2104
phoeenniixx merged 2 commits intosktime:mainfrom
Gyanam1310:improve-groupby-apply-error-message

Conversation

@Gyanam1310
Copy link
Contributor

Reference Issues/PRs

None.

What does this implement/fix? Explain your changes.

This PR improves the error message raised when an invalid reduction
argument is passed to groupby_apply.

Previously, the error message only stated that the reduction was unknown.
This update clarifies the expected valid options: {'mean', 'sum'}.

No functional behavior is changed.

What should a reviewer concentrate their feedback on?

  • Clarity and wording of the updated error message.
  • Whether the expected options are correctly specified.

Did you add any tests for the change?

No. This change only improves the error message wording and does not
modify functionality.

Any other comments?

This is a minor maintenance improvement to make debugging clearer
for users passing invalid arguments.

@codecov
Copy link

codecov bot commented Feb 27, 2026

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@6b27898). Learn more about missing BASE report.

Files with missing lines Patch % Lines
pytorch_forecasting/utils/_utils.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2104   +/-   ##
=======================================
  Coverage        ?   86.63%           
=======================================
  Files           ?      165           
  Lines           ?     9732           
  Branches        ?        0           
=======================================
  Hits            ?     8431           
  Misses          ?     1301           
  Partials        ?        0           
Flag Coverage Δ
cpu 86.63% <0.00%> (?)
pytest 86.63% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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

@phoeenniixx phoeenniixx left a comment

Choose a reason for hiding this comment

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

Thanks!

@phoeenniixx phoeenniixx added the maintenance Continuous integration, unit testing & package distribution label Mar 1, 2026
@phoeenniixx phoeenniixx merged commit 1952984 into sktime:main Mar 4, 2026
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Continuous integration, unit testing & package distribution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants