Giter VIP home page Giter VIP logo

Comments (8)

RobertCraigie avatar RobertCraigie commented on June 12, 2024

Huh this is very weird, I've never seen this before.

If you set the PRISMA_PY_DEBUG_GENERATOR and PRISMA_PY_DEBUG environment variables to 1 you should see some debug logs and the config that Prisma Client Python will be written to prisma/generator/debug-params.json (the absolute path should be show in the logs). Could you share that JSON file please?

from prisma-client-py.

ezorita avatar ezorita commented on June 12, 2024

Thanks Robert!

I did set the env vars and I see some debug logs when using the client, but the debug-params.json file is not generated (can't locate it anywhere in the file system). Is there anything else I should enable?

from prisma-client-py.

RobertCraigie avatar RobertCraigie commented on June 12, 2024

Huh, you should see logs that look like this:

$ PRISMA_PY_DEBUG=1 PRISMA_PY_DEBUG_GENERATOR=1 prisma generate --schema=tests/data/schema.prisma
[DEBUG  ] prisma.cli.prisma: Running prisma command with args: ['generate', '--schema=tests/data/schema.prisma']
[DEBUG  ] prisma.cli._node: Checking if nodejs-bin is installed
[DEBUG  ] prisma.cli._node: Using nodejs-bin with version: 18.4.0
[DEBUG  ] prisma.cli._node: Attempting to preprend /Users/robert/code/prisma-client-py/.venv/lib/python3.10/site-packages/nodejs/bin to the PATH
[DEBUG  ] prisma.cli._node: Using PATH environment variable: /Users/robert/code/prisma-client-py/.venv/lib/python3.10/site-packages/nodejs/bin:/Users/robert/code/prisma-client-py/.venv/bin:/Users/robert/.local/bin:/Users/robert/Library/Python/3.10/bin:/Users/robert/Library/pnpm:/Users/robert/Library/Python/3.9/bin:/opt/homebrew/opt/openjdk@11/bin:/opt/homebrew/opt/libxslt/bin:/Users/robert/.poetry/bin:/Users/robert/.nvm/versions/node/v16.14.2/bin:/Users/robert/.pyenv/shims:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Apple/usr/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Applications/Postgres.app/Contents/Versions/latest/bin:/Users/robert/.codon/bin:/Users/robert/.cargo/bin
Environment variables loaded from .env
Prisma schema loaded from tests/data/schema.prisma
  prisma:GeneratorProcess  [DEBUG  ] prisma.generator.jsonrpc: Replied with {"id": 1, "jsonrpc": "2.0", "result": {"manifest": {"prettyName": "Prisma Client Python (v0.8.1a)", "defaultOutput": "/Users/robert/code/prisma-client-py/src/prisma", "denylist": null, "requiresEngines": ["queryEngine"], "requiresGenerators": null}}} +0ms
  prisma:GeneratorProcess  [DEBUG  ] prisma.generator.generator: Wrote generator params to /Users/robert/code/prisma-client-py/src/prisma/generator/debug-params.json +60ms
  prisma:GeneratorProcess  [DEBUG  ] prisma.generator.generator: Wrote generator data to /Users/robert/code/prisma-client-py/src/prisma/generator/debug-data.json +54ms

There will be more logs than this but can you see the line that says Wrote generator params to <path> in your local logs?

from prisma-client-py.

ezorita avatar ezorita commented on June 12, 2024

My bad, I was trying to load the client module in python instead! Got it and sent it to you via email.

Eduard

from prisma-client-py.

RobertCraigie avatar RobertCraigie commented on June 12, 2024

hmm this is really strange...

Thanks for sending those logs over! I can't see anything in there that looks suspicious unfortunately, I was thinking it could be because something internally between the schema parsing and the config parsing is going wrong but it looks completely normal to me.

I also can't replicate this using your data which is even stranger.

This is the script I'm using to try to replicate the issue:

from pathlib import Path
from prisma.generator import models as m

m.DEBUG_GENERATOR = True

params_file = Path("<path to params.json>")
contents = params_file.read_text()

d = m.PythonData.parse_raw(contents)

This doesn't print any warnings for me...

If I modify the debug-params.json file to remove the "recursive_type_depth": 5 entry then it works as expected and prints a warning.

I have no idea what's really going wrong here :/

from prisma-client-py.

ezorita avatar ezorita commented on June 12, 2024

Thanks for looking into this @RobertCraigie. No worries, I can just ignore it for now, I will let you know if I eventually figure out what is causing it.

from prisma-client-py.

awarebayes avatar awarebayes commented on June 12, 2024

Did you figure it out?

from prisma-client-py.

ezorita avatar ezorita commented on June 12, 2024

Did you figure it out?

Not really, I just ended up replacing that piece of code on the fly for production installs...

from prisma-client-py.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.