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

Remove warning when Annotion enum is created #28048

Merged
merged 1 commit into from
Dec 14, 2023

Conversation

amyeroberts
Copy link
Collaborator

@amyeroberts amyeroberts commented Dec 14, 2023

What does this PR do?

The Annotion enum was deprecated in #26941.

I asked for there to be a deprecation warning to let users know if they chose to use the enum. This was overly defensive and in light of recent complaints of objects being removed/moved from the library (even if they were never meant to be used directly).

However, complete oversight on my part is that the init of the enum will be created any time any object from the image_utils module file is imported - resulting in verbose error messages unrelated to what the user was trying to do - my bad.

This PR removed the warning from the enum itself and adds it into a validation check that happens on annotations.

It ultimately means that we might break things when we remove Annotion - but this is likely to be very unlikely and with a simple, quick resolution.

Partially resolves #28042

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?

@amyeroberts amyeroberts changed the title Remove warning when enum is created Remove warning when Annotion enum is created Dec 14, 2023
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@amyeroberts amyeroberts requested a review from ydshieh December 14, 2023 18:28
Copy link
Contributor

@patrickvonplaten patrickvonplaten left a comment

Choose a reason for hiding this comment

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

Nice!

@amyeroberts amyeroberts merged commit 1a585c1 into huggingface:main Dec 14, 2023
21 checks passed
iantbutler01 pushed a commit to BismuthCloud/transformers that referenced this pull request Dec 16, 2023
staghado pushed a commit to staghado/transformers that referenced this pull request Jan 15, 2024
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.

Confusing deprecation / warning messages
3 participants