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
(v3) Cast potentially translated strings used as descriptions #976
Conversation
…translation Before graphql-core had issues processing descriptions generated from translatable help_text during schema generation. Involved graphql-core utilities expect descriptions to be of type `str`, however, the generated descriptions were of type `django.utils.functional.__proxy__` which caused concatination with actual strings to fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @DoctorJohn !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I've just noticed that the tests are failing. Could you fix them?
I already took a look at both failing tests on my machine and I figured that their failure is not related to my changes (they already failed without my changes). I'm working on a patch to fix those tests but thought it would be better to submit it separately. |
Never mind, I might be mistaking. Lemme take another look |
308511e
to
1a0fed0
Compare
@jkimbo I fixed the issue causing the tests to fail. Feel free to take another look |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks
Released a new beta version with this change |
graphql-python#976 casts all the description fields to strings to prevent schema printing from failing whenever the description is a lazy translated string. The `DecimalField` however got in after the v3 merge and it currently misses the cast.
* Cast translated description for DecimalField #976 casts all the description fields to strings to prevent schema printing from failing whenever the description is a lazy translated string. The `DecimalField` however got in after the v3 merge and it currently misses the cast. * Fix row size
* Cast translated description for DecimalField graphql-python/graphene-django#976 casts all the description fields to strings to prevent schema printing from failing whenever the description is a lazy translated string. The `DecimalField` however got in after the v3 merge and it currently misses the cast. * Fix row size
* Cast translated description for DecimalField graphql-python/graphene-django#976 casts all the description fields to strings to prevent schema printing from failing whenever the description is a lazy translated string. The `DecimalField` however got in after the v3 merge and it currently misses the cast. * Fix row size
* Cast translated description for DecimalField graphql-python/graphene-django#976 casts all the description fields to strings to prevent schema printing from failing whenever the description is a lazy translated string. The `DecimalField` however got in after the v3 merge and it currently misses the cast. * Fix row size
* Cast translated description for DecimalField graphql-python/graphene-django#976 casts all the description fields to strings to prevent schema printing from failing whenever the description is a lazy translated string. The `DecimalField` however got in after the v3 merge and it currently misses the cast. * Fix row size
* Cast translated description for DecimalField graphql-python#976 casts all the description fields to strings to prevent schema printing from failing whenever the description is a lazy translated string. The `DecimalField` however got in after the v3 merge and it currently misses the cast. * Fix row size
* Cast translated description for DecimalField graphql-python/graphene-django#976 casts all the description fields to strings to prevent schema printing from failing whenever the description is a lazy translated string. The `DecimalField` however got in after the v3 merge and it currently misses the cast. * Fix row size
This PR fixes #975 by explicitly casting all potentially translated strings used as descriptions to
str
. (graphql-core
and itsprint_schema
utility expects descriptions to be of typestr
).