Add test and fix stub for sklearn.config_context#3155
Add test and fix stub for sklearn.config_context#3155fhoehle wants to merge 2 commits intofacebook:mainfrom
sklearn.config_context#3155Conversation
|
Hi @fhoehle! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
rchen152
left a comment
There was a problem hiding this comment.
Thanks for the PR! Pyrefly's bundled sklearn stubs are mirrored from here:
. So rather than editing our bundled copy, it would be better to fix the stubs upstream and then bundle a fresh copy.(If you get pushback on or lack of response to an upstream PR, we can consider doing a local patch instead. We'd need to record the patch somewhere, so we know what we've modified.)
Summary
This PR adds a new test asserting that the
sklearn.config_contextcontext manager is correctly understood.The initial failing test is fixed by correcting the corresponding
sklearn.config_contexttype hint and adding thecontextlib.contextmanagerdecorator.Issue #3154 describes the observed error. The originating cause is the incorrect
sklearn-stubin thepyrefly_bundledcrate.The deprecation warning regarding
Iterator[None]is mitigated by replacing it withGeneratorTest Plan
03b707d7bb6aeb55d9c5f2b6dd7b6e7367fe43a4, which failed with the above-describedbad-context-managererror.cargo test -p pyrefly --lib test_sklearntest.py