mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-10 08:28:25 +00:00
Merge 94acbcea02 into 570f41daad
This commit is contained in:
commit
e2e472d327
2 changed files with 11 additions and 0 deletions
|
|
@ -93,6 +93,9 @@ class _InvalidIndex:
|
|||
MAX_MIGRATE_DEPLOY_ATTEMPTS = 4
|
||||
LIBPQ_URL_PARAMS: Final = frozenset(
|
||||
{
|
||||
"host",
|
||||
"hostaddr",
|
||||
"port",
|
||||
"sslmode",
|
||||
"sslcert",
|
||||
"sslkey",
|
||||
|
|
|
|||
|
|
@ -71,6 +71,14 @@ def test_strip_prisma_query_params_passthrough_no_query():
|
|||
assert ProxyExtrasDBManager._strip_prisma_query_params(url) == url
|
||||
|
||||
|
||||
def test_strip_prisma_query_params_preserves_host_socket():
|
||||
"""Unix-socket DATABASE_URLs using host parameter (e.g. Cloud SQL) must be preserved."""
|
||||
url = "postgresql://user:pass@localhost/litellm?host=/cloudsql/project:region:instance&connection_limit=10"
|
||||
stripped = ProxyExtrasDBManager._strip_prisma_query_params(url)
|
||||
assert "host=%2Fcloudsql%2Fproject%3Aregion%3Ainstance" in stripped
|
||||
assert "connection_limit" not in stripped
|
||||
|
||||
|
||||
def test_migration_timestamp_extracts_leading_digits():
|
||||
assert _migration_timestamp("20260101000000_add_foo") == 20260101000000
|
||||
assert _migration_timestamp("20250326162113_baseline") == 20250326162113
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue