graphene icon indicating copy to clipboard operation
graphene copied to clipboard

Get rid of Deprecation Warnings

Open patillacode opened this issue 2 years ago • 3 comments

In my current project which depends on graphene (3.3) I encountered my logs unusable since they were heavily polluted with the following warning:

/home/wagtail/.local/lib/python3.9/site-packages/graphene/utils/subclass_with_meta.py:46: DeprecationWarning: Creating a DjangoObjectType without either the `fields` or the `exclude` option is deprecated. Add an explicit `fields = '__all__'` option on DjangoObjectType CollectionObjectType to use all fields

While trying to fix it just by adding the fields="__all__" option I stumbled upon this other one:

/home/wagtail/.local/lib/python3.9/site-packages/graphene/utils/subclass_with_meta.py:46: DeprecationWarning: Defining `exclude_fields` is deprecated in favour of `exclude`.

I believe this PR would make those warnings disappear without breaking anything AFAIK, at least that is what I found while testing it.

patillacode avatar Nov 22 '23 10:11 patillacode

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (5fb7b54) 96.01% compared to head (63ca079) 95.96%.

Files Patch % Lines
graphene/utils/subclass_with_meta.py 75.00% 1 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1530      +/-   ##
==========================================
- Coverage   96.01%   95.96%   -0.05%     
==========================================
  Files          51       51              
  Lines        1755     1759       +4     
==========================================
+ Hits         1685     1688       +3     
- Misses         70       71       +1     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Nov 22 '23 12:11 codecov[bot]

Would it be possible to get this merged?

ssyberg avatar Mar 13 '24 17:03 ssyberg

Sorry for the late response. To me it looks like this is an issue that should be fixed in graphene_django, namely removing the use of a deprecated field in graphene. I'd prefer a solution that uses the newest standard in graphene instead of un-deprecating the deprecated option in the core library. Can you open a PR there?

erikwrede avatar Mar 13 '24 17:03 erikwrede