Comments (8)
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.
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.
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.
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.
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.
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.
Did you figure it out?
from prisma-client-py.
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)
- How to import enum values by prisma-client-py ? HOT 1
- Support schemas that are using the preview feature relationJoins on different generators HOT 1
- Generate Async and Sync client together at the same time HOT 2
- httpx.ConnectError: All connection attempts failed HOT 1
- Once event loop is closed, async client can not be used anymore. HOT 2
- Support accessing the DMMF at runtime HOT 1
- P1011: Error opening a TLS connection: bad protocol version
- Upgrading version from 0.11.0 to 0.12.0 in Elastic Beanstalk fails deployment HOT 1
- Avoid writing to `site-packages/prisma` HOT 1
- When generator client output is set, `prisma db push` fails with Permission Denied
- Is there a way to override use_enum_values?
- `prisma db push` does not work
- v0.13.0 - ImportError: cannot import name 'AbstractEngine' from 'prisma.engine' HOT 4
- Oracle Database not support like alchemy HOT 1
- Oracle not support HOT 1
- httpx.ConnectError: [Errno 111] Connection refused HOT 3
- RuntimeError('Event loop is closed') HOT 2
- schema.prisma on custom path HOT 3
- Bump Prisma version to latest 5.12.1
- Client extension support HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prisma-client-py.