Skip to content

Issue 703 -- support for Decimal type #726

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

Merged
merged 8 commits into from
Jul 24, 2018

Conversation

picturedots
Copy link
Contributor

@picturedots picturedots commented May 15, 2018

@picturedots
Copy link
Contributor Author

If someone can explain why the python 2.7 tests are failing, and how to run the travis builds locally I can fix the travis errors.

@jkimbo
Copy link
Member

jkimbo commented May 15, 2018

@picturedots you'll need to setup a virtualenv with python 2.7 Then run the commands in the contributing section in the readme: https://github.com/graphql-python/graphene#contributing

Looks like the flake8 (for linting) is not included in the requirements so you'll need to install it first before running it.

@jkimbo
Copy link
Member

jkimbo commented May 15, 2018

Also thanks for the PR! It's looking great

@jplock
Copy link

jplock commented Jun 5, 2018

Anyway we can get this into the next release?

@picturedots
Copy link
Contributor Author

I got stalled on the tests and forgot to come back to this -- when is the next release?

@jplock
Copy link

jplock commented Jun 6, 2018

I don't think there's any set schedule, I've just been noticing some release-related activity on the various graphql-python projects and thought a new graphene release was imminent.

@jplock
Copy link

jplock commented Jun 6, 2018

@picturedots maybe try adding 'Decimal' into __all__ in graphene\__init__.py to fix the linting issue

@jkimbo jkimbo requested review from syrusakbary and jkimbo June 9, 2018 15:29
@picturedots
Copy link
Contributor Author

I appreciate the updates to the "Contributing" section in README.MD -- I will see if I can finally get this finished this week.

@jplock
Copy link

jplock commented Jul 16, 2018

To be ahead of #794, we could raise assertion errors.

@picturedots
Copy link
Contributor Author

@jplock It looks like #794 is going to provide a helper method once its accepted, so maybe it's best to wait. I did, however fix some linting errors that complained about assert x == None and converted to assert is None.

@picturedots
Copy link
Contributor Author

It looks like there are black formatting errors in test_mutation.py from the master branch that is breaking tox for me. @sebdiem do you know anything about this? If somebody can fix it on master then I can merge in that change to clear the Travis errors.

@sebdiem
Copy link
Contributor

sebdiem commented Jul 19, 2018

@picturedots done: #802

@picturedots
Copy link
Contributor Author

This should be all good to go now, @jplock -- unfortunately it looks like I missed the latest release.

@jplock
Copy link

jplock commented Jul 20, 2018

Thanks for all the efforts @picturedots! @jkimbo @syrusakbary think this could make the next release?

Copy link
Member

@jkimbo jkimbo left a comment

Choose a reason for hiding this comment

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

This looks good thanks @picturedots

There are a couple of PR's ready for a 2.2 release so it would be great to get it in that. Also when you get the chance could you add the Decimal type to the docs?

@jkimbo
Copy link
Member

jkimbo commented Jul 24, 2018

@syrusakbary merge whenever you're happy

@syrusakbary syrusakbary merged commit d728b84 into graphql-python:master Jul 24, 2018
def parse_value(value):
try:
return _Decimal(value)
except ValueError:

Choose a reason for hiding this comment

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

Shouldn't it check for decimal.DecimalException here, as for example Django does? I've copied your changes to my repo (as it hasn't been released yet) and I'm trying to use it in my mutations, but when providing invalid values like an empty string I'm getting:

{
  "errors": [
    {
      "message": "[<class 'decimal.ConversionSyntax'>]"
    }
  ]
}

Copy link

Choose a reason for hiding this comment

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

@maarcingebala can you submit a pull request with this change so it can be reviewed?

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.

7 participants