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

Added money type to SQLA_TYPE_MAPPING #218

Merged
merged 2 commits into from Jun 18, 2019
Merged

Conversation

heckad
Copy link
Contributor

@heckad heckad commented Jun 16, 2019

No description provided.

@heckad
Copy link
Contributor Author

heckad commented Jun 16, 2019

Why py27-lowest don't have MONEY? It's correct?

@sloria
Copy link
Member

sloria commented Jun 17, 2019

It's probably not a py2-specific issue. Looks like our lowest supported SQLAlchemy version (0.9.7) doesn't support MONEY. I'm up for bumping up the minimum version; could you find which SQLA version adds MONEY?

@AbdealiLoKo
Copy link
Collaborator

May be better to add a check and add this field only if the sqla version is > some value rather than bumping it up

@sloria
Copy link
Member

sloria commented Jun 17, 2019

I'm fine with either. Looks like it was added in 1.2, which is ~1.5 years old at this point.

@heckad
Copy link
Contributor Author

heckad commented Jun 17, 2019

So what are we doing? We update the version or we write factory?

@sloria
Copy link
Member

sloria commented Jun 17, 2019

Well, we're already doing

    if hasattr(sa, "JSON"):
        SQLA_TYPE_MAPPING[sa.JSON] = fields.Raw

so we could do something similar

    if hasattr(postgres, "MONEY"):
        SQLA_TYPE_MAPPING[postgres.MONEY] = fields.Decimal

@heckad
Copy link
Contributor Author

heckad commented Jun 17, 2019

Done

@heckad
Copy link
Contributor Author

heckad commented Jun 18, 2019

When it will be merged?

@sloria sloria merged commit ff3ffa3 into marshmallow-code:dev Jun 18, 2019
@sloria
Copy link
Member

sloria commented Jun 18, 2019

Will probably release this over the weekend.

@heckad
Copy link
Contributor Author

heckad commented Jun 18, 2019

Thanks!

@heckad heckad deleted the patch-1 branch June 18, 2019 22:08
@sloria
Copy link
Member

sloria commented Jun 22, 2019

This is released in 0.17.0

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.

None yet

3 participants