fix: allow empty password when reloading pgvector-family results - #847
Open
serhiizghama wants to merge 2 commits into
Open
fix: allow empty password when reloading pgvector-family results#847serhiizghama wants to merge 2 commits into
serhiizghama wants to merge 2 commits into
Conversation
A run using an empty password (local trust/peer auth) saves a result whose db_config carries password="". Reopening it rehydrated the config through DBConfig.not_empty_field, which rejected the empty password with "Empty field(s): password" and made the results page fail to load. Skip password in the empty-field guard for the postgres-connection-string configs (pgvector, pgvectorscale, alloydb) and give the credential/db_name fields defaults so older result files that omit them still rehydrate. Mirrors how tidb, milvus and adbpg already handle this.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: serhiizghama The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #831.
If you run pgvector with an empty password (local
trust/peerauth, which is the default on a fresh local Postgres), the saved result storespassword: "". Reopening that result then blows up withPgVectorConfig Value error, Empty field(s): passwordand the results page won't render — you have to hand-edit the JSON to add a fake password.The cause is
DBConfig.not_empty_field: it rejects any empty string field, but on the reload path an empty password is legitimate, not a misconfiguration. I addedpasswordto the config's_extra_empty_skipset so the guard leaves it alone — the same mechanismtidbandmilvusalready use, and the same class of reload bugadbpgwas fixed for. I also gavepassword/db_namedefaults so older result files that omit those fields rehydrate cleanly.The reporter hit the same thing on PgVectorScale (it additionally complained about
db_name), so I fixed the whole postgres-connection-string family — pgvector, pgvectorscale and alloydb share identical config code and the identical bug.Tests in
tests/test_pgvector_config_roundtrip.pycover the reload shapes (password empty-and-present, and absent) for all three, plus a negative control confirming the empty-field guard still fires for non-credential fields likehost. They fail onmainand pass here; ruff and black are clean.