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

prisma generate crash with new release of pydantic (1.9.1) #402

Closed
ArthurMelin opened this issue May 19, 2022 · 2 comments · Fixed by #403
Closed

prisma generate crash with new release of pydantic (1.9.1) #402

ArthurMelin opened this issue May 19, 2022 · 2 comments · Fixed by #403
Labels
bug/2-confirmed We have confirmed that this is a bug. kind/bug A reported bug. priority/high

Comments

@ArthurMelin
Copy link

Bug description

prisma generate crashes with this error when pydantic 1.9.1 is installed by pip as a dependency:

$ prisma generate
Prisma schema loaded from prisma/schema.prisma
Error:
  File "pydantic/main.py", line 341, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 1 validation error for Model
info
  cannot pickle 'generator' object (type=type_error)

How to reproduce

  1. Install prisma from pip
  2. If the installed version of pydantic is not 1.9.1, force the install of this version with pip install pydantic==1.9.1
  3. prisma generate any schema
  4. See error

Expected behavior

No error

Prisma information

datasource db {
  provider = "postgresql"
  url      = env("DATABASE_URL")
}

generator client_py {
  provider  = "prisma-client-py"
  interface = "sync"
  output    = "../src/thoth_database/prisma"
}

model Article {
  article_id Int @id @default(autoincrement())
}

Environment & setup

  • OS: Linux
  • Database: PostgreSQL
  • Python version: Pyhon 3.9.10
  • Prisma version:
prisma               : 3.13.0
prisma client python : 0.6.5
platform             : debian-openssl-1.1.x
engines              : efdf9b1183dddfd4258cd181a72125755215ab7b
install path         : /home/elassyo/.pyenv/versions/3.9.10/lib/python3.9/site-packages/prisma
installed extras     : []
@ArthurMelin
Copy link
Author

For those interested, the workaround until this is fixed is to force pydantic==1.9.0 in your requirements

@RobertCraigie RobertCraigie added bug/2-confirmed We have confirmed that this is a bug. kind/bug A reported bug. priority/high process/candidate Candidate for the next release labels May 19, 2022
@RobertCraigie
Copy link
Owner

Thanks for the fast bug report! This issue will be fixed in the next release.

@RobertCraigie RobertCraigie removed the process/candidate Candidate for the next release label May 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/2-confirmed We have confirmed that this is a bug. kind/bug A reported bug. priority/high
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants