-
Notifications
You must be signed in to change notification settings - Fork 161
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
Warnings for deprecated datapipes are insufficient #322
Comments
@pmeier Thanks for the suggestion. I think your version is better and you should send a PR. For your convenience, here is the list of DataPipes being deprecated: Two small complications:
My suggestion to minimize CI breakage:
I can definitely make these PRs and merge them if you prefer that. |
Not sure why this an issue. If you look into my suggestion above, only deprecation_warning("RoutedDecoder")
This is internal functionality, right? In that case I wouldn't worry to much. You are looking at one day of failure, which is kind of ok for code that lives in separated libraries IMO. |
Sounds reasonable, feel free to put in a PR |
Summary: Fixes pytorch/data#322. Pull Request resolved: #74685 Reviewed By: mrshenli Differential Revision: D35143494 Pulled By: NivekT fbshipit-source-id: b87c312a93ea6a8ce2090da961312cb7e2cbc2eb
Summary: Fixes pytorch/data#322. Pull Request resolved: #74685 Reviewed By: mrshenli Differential Revision: D35143494 Pulled By: NivekT fbshipit-source-id: b87c312a93ea6a8ce2090da961312cb7e2cbc2eb (cherry picked from commit cb74b81)
Consider this snippet:
There are three problems here:
Running this with
python $SCRIPT
will not give you any warning, becauseDeprecationWarning
's are filtered by default. They are only visible if a user activates them manually, i.e. runningpython -Wd $SCRIPT
:Since most users won't do that, we should using a
FutureWarning
, which is the user-facing deprecation warning.Since the warning is emitted from
__new__
, we should usecls.__name__
. Usingtype(cls).__name__
will give us the name of the meta class as seen as_DataPipeMeta
above.If I used the functional API, it can be quite confusing what caused the warning. For example with the above fixed, the warning is
I have no
TarArchiveReaderIterDataPipe
in my code. Even if I had used the class interface, i.e.from torchdata.datapipes.iter import TarArchiveReader
, there would still be a mismatch between my code and the warning.I propose to switch
deprecation_warning
to something likeWith this, the warning for the code above reads:
LMK if I should send a PR to PyTorch core.
The text was updated successfully, but these errors were encountered: