Skip to content

Add stacklevel to warnings.warn calls#137

Merged
RNKuhns merged 1 commit into
sktime:mainfrom
RNKuhns:warning_stack_level
Feb 23, 2023
Merged

Add stacklevel to warnings.warn calls#137
RNKuhns merged 1 commit into
sktime:mainfrom
RNKuhns:warning_stack_level

Conversation

@RNKuhns
Copy link
Copy Markdown
Contributor

@RNKuhns RNKuhns commented Feb 23, 2023

Reference Issues/PRs

flake8 raises a warning for calls to warnings.warn that don't specify the stacklevel parameter. stacklevel controls where the warning is shown from. Using stacklevel=2 raises the warning at the code 1-level above the warnings.warn call, which seems like a reasonable default.

PR checklist

For all contributions
  • I've reviewed the project documentation on contributing
  • I've added myself to the list of contributors.
  • The PR title starts with either [ENH], [CI/CD], [MNT], [DOC], or [BUG] indicating whether
    the PR topic is related to enhancement, CI/CD, maintenance, documentation, or a bug.
For code contributions
  • Unit tests have been added covering code functionality
  • Appropriate docstrings have been added (see documentation standards)
  • New public functionality has been added to the API Reference

@RNKuhns RNKuhns requested a review from fkiraly February 23, 2023 04:13
@RNKuhns RNKuhns added this to the Release 0.4.0 milestone Feb 23, 2023
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Feb 23, 2023

Codecov Report

Merging #137 (69e4498) into main (4de5c36) will not change coverage.
The diff coverage is 20.00%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@           Coverage Diff           @@
##             main     #137   +/-   ##
=======================================
  Coverage   82.03%   82.03%           
=======================================
  Files          30       30           
  Lines        2249     2249           
=======================================
  Hits         1845     1845           
  Misses        404      404           
Impacted Files Coverage Δ
skbase/base/_base.py 83.21% <0.00%> (ø)
skbase/lookup/_lookup.py 95.48% <0.00%> (ø)
skbase/testing/utils/_dependencies.py 57.42% <33.33%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@RNKuhns
Copy link
Copy Markdown
Contributor Author

RNKuhns commented Feb 23, 2023

@fkiraly this is a blocker for other PRs, because it causes CI to fail.

Copy link
Copy Markdown
Contributor

@fkiraly fkiraly left a comment

Choose a reason for hiding this comment

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

Yes, I know - I already fixed it in sktime in some places.

@RNKuhns RNKuhns merged commit 7bd9547 into sktime:main Feb 23, 2023
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.

3 participants