Litellm expose disable schema update flag (#6085)

* fix: enable new 'disable_prisma_schema_update' flag

* build(config.yml): remove setup remote docker step

* ci(config.yml): give container time to start up

* ci(config.yml): update test

* build(config.yml): actually start docker

* build(config.yml): simplify grep check

* fix(prisma_client.py): support reading disable_schema_update via env vars

* ci(config.yml): add test to check if all general settings are documented

* build(test_General_settings.py): check available dir

* ci: check ../ repo path

* build: check ./

* build: fix test
This commit is contained in:
Krish Dholakia 2024-10-05 21:26:51 -04:00 committed by GitHub
parent f2c0a31e3c
commit 04e5963b65
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 598 additions and 44 deletions

View file

@ -1055,27 +1055,7 @@ class PrismaClient:
try:
from prisma import Prisma # type: ignore
except Exception:
os.environ["DATABASE_URL"] = database_url
# Save the current working directory
original_dir = os.getcwd()
# set the working directory to where this script is
abspath = os.path.abspath(__file__)
dname = os.path.dirname(abspath)
os.chdir(dname)
try:
subprocess.run(["prisma", "generate"])
subprocess.run(
["prisma", "db", "push", "--accept-data-loss"]
) # this looks like a weird edge case when prisma just wont start on render. we need to have the --accept-data-loss
except Exception as e:
raise Exception(
f"Unable to run prisma commands. Run `pip install prisma` Got Exception: {(str(e))}"
)
finally:
os.chdir(original_dir)
# Now you can import the Prisma Client
from prisma import Prisma # type: ignore
raise Exception("Unable to find Prisma binaries.")
verbose_proxy_logger.debug("Connecting Prisma Client to DB..")
if http_client is not None:
self.db = PrismaWrapper(