graphql-python / graphene-sqlalchemy

Graphene SQLAlchemy integration
http://docs.graphene-python.org/projects/sqlalchemy/en/latest/
MIT License
974 stars 225 forks source link

Fix decimal type conversion #376

Closed jendrikjoe closed 1 year ago

jendrikjoe commented 1 year ago

With the merge of #371, the conversion of Decimal columns broke for us. I added a decimal column as we are creating them to the test model reproducing it and a possible fix, by registering the type to the converter.

codecov[bot] commented 1 year ago

Codecov Report

Base: 96.36% // Head: 96.36% // Increases project coverage by +0.00% :tada:

Coverage data is based on head (6b036ac) compared to base (d3a4320). Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #376 +/- ## ======================================= Coverage 96.36% 96.36% ======================================= Files 9 9 Lines 908 909 +1 ======================================= + Hits 875 876 +1 Misses 33 33 ``` | [Impacted Files](https://codecov.io/gh/graphql-python/graphene-sqlalchemy/pull/376?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=graphql-python) | Coverage Δ | | |---|---|---| | [graphene\_sqlalchemy/converter.py](https://codecov.io/gh/graphql-python/graphene-sqlalchemy/pull/376?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=graphql-python#diff-Z3JhcGhlbmVfc3FsYWxjaGVteS9jb252ZXJ0ZXIucHk=) | `95.83% <100.00%> (+0.01%)` | :arrow_up: | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=graphql-python). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=graphql-python)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

erikwrede commented 1 year ago

Sorry for the late reply. I have received multiple messages about this, so I am considering making changes to the type conversion system introduced in #371 so that we keep supporting the conversion of subclasses of registered classes. This adds a lot of convenience since every driver has custom subtypes for bigint, integer and others. Please check out #377 to see if that fixes your issues and give me some feedback ☺️ I will add the necessary tests tomorow.

jendrikjoe commented 1 year ago

Sorry for the late reply. I have received multiple messages about this, so I am considering making changes to the type conversion system introduced in #371 so that we keep supporting the conversion of subclasses of registered classes. This adds a lot of convenience since every driver has custom subtypes for bigint, integer and others. Please check out #377 to see if that fixes your issues and give me some feedback ☺️ I will add the necessary tests tomorow.

No worries. Solving this in a generic way definitely seems reasonable 👍 Will close this one in favor of #377 👍