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

feat(types): map types to builtins #395

Merged

Conversation

leejayhsu
Copy link
Contributor

@leejayhsu leejayhsu commented May 11, 2022

Change Summary

To allow field names to shadow builtin type names , prepend these builtin types with _.

from builtins import bool as _bool
from builtins import int as _int
from builtins import float as _float
from builtins import str as _str

Closes #188.

Checklist

  • Unit tests for the changes exist
  • Tests pass without significant drop in coverage
  • Documentation reflects changes where applicable
  • Test snapshots have been updated if applicable

Agreement

By submitting this pull request, I confirm that you can use, modify, copy and redistribute this contribution, under the terms of your choice.

@codecov
Copy link

codecov bot commented May 11, 2022

Codecov Report

Merging #395 (bb754b5) into main (56a365c) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #395   +/-   ##
=======================================
  Coverage   94.14%   94.14%           
=======================================
  Files         114      114           
  Lines        5789     5789           
  Branches      325      325           
=======================================
  Hits         5450     5450           
  Misses        300      300           
  Partials       39       39           
Impacted Files Coverage Δ
src/prisma/generator/models.py 92.01% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 56a365c...bb754b5. Read the comment docs.

@leejayhsu leejayhsu marked this pull request as ready for review May 11, 2022 07:20
@RobertCraigie
Copy link
Owner

Great work, thank you so much! 💜

Apologies that it's taken so long for me to get around to merging this.

@RobertCraigie RobertCraigie merged commit 1462561 into RobertCraigie:main Jun 2, 2022
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.

Builtin types should be mapped to the builtins module
2 participants