Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a missing raise in kdeplot and slightly improve lmplot signature #3602

Merged
merged 1 commit into from
Dec 23, 2023

Conversation

hamdanal
Copy link
Contributor

I noticed these while working on the stubs at typeshed. They felt small enough to include in a single PR.

  1. There is a missing raise before TypeError(msg) in kdeplot
  2. The data parameter of lmplot is required but it has a default of None. 20 lines later there is a check that raises a TypeError if data is None. Removing the default makes sense here to signal to the user that they must pass this argument. It also has two more advantages. The first is that your IDE will now helpfully yell at you if you don't pass the argument. The second is minor but it will allow us to keep running the stub tests for this function at typeshed where we removed the default which made the stub go out of sync with the runtime implementation so we had to skip its tests to pass CI. Note that there is no user facing change here as calling the function without passing data still raises a TypeError with a clear message.

I noticed these while working on the stubs at typeshed.
They felt small enough to include in a single PR.

1. There is a missing `raise ` before `TypeError(msg)` in `kde_plot`
2. The `data` parameter of `lmplot` is required but it has a default of `None`. 20 lines later
   there is a check that raises a `TypeError` if `data is None`. Removing the default makes
   sense here to signal to the user that they must pass this argument. It also has two more
   advantages. The first is that your IDE will now helpfully yell at you if you don't pass the
   argument. The second is minor but it will allow us to keep running the stub tests for this
   function at typeshed where we removed the default which made the stub go out of sync with
   the runtime implementation so we had to skip its tests to pass CI. Note that there is no
   user facing change here as calling the function without passing `data` still raises a
   `TypeError` with a clear message.
Copy link

codecov bot commented Dec 23, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (5051ede) 98.52% compared to head (80cf894) 98.52%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3602   +/-   ##
=======================================
  Coverage   98.52%   98.52%           
=======================================
  Files          75       75           
  Lines       24701    24704    +3     
=======================================
+ Hits        24336    24340    +4     
+ Misses        365      364    -1     
Files Coverage Δ
seaborn/distributions.py 96.42% <100.00%> (+0.21%) ⬆️
seaborn/regression.py 98.21% <ø> (-0.30%) ⬇️
tests/test_distributions.py 99.80% <100.00%> (+<0.01%) ⬆️

@mwaskom mwaskom added the bugfix label Dec 23, 2023
@mwaskom mwaskom added this to the v0.13.1 milestone Dec 23, 2023
@mwaskom mwaskom merged commit cfa74b4 into mwaskom:master Dec 23, 2023
11 checks passed
@mwaskom
Copy link
Owner

mwaskom commented Dec 23, 2023

Thanks!

@hamdanal hamdanal deleted the minor-fixes branch December 23, 2023 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants