chore(ingestion): report duplicate observations without psql - #850
Merged
Conversation
The SQL version of this check needs a psql client and a database password, neither of which is available on a machine that has only gcloud. This does the same counting through the Cloud SQL connector with IAM authentication, so the credential is the operator's own login and nothing is stored. It reports and does not resolve. Which copy to keep is a judgement about the data: groups whose values disagree are conflicting measurements rather than redundant rows, and collapsing them would discard a reading somebody recorded. The failure path is the useful part -- a principal without a database user gets a Postgres authentication error that reads like a bad password, so the message names the gcloud command that creates one. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
Coverage✅ 79.45% total — gate is 75%. Coverage for the Python files changed in this PR
|
Contributor
|
Your pull request is automatically being deployed to Dagster Cloud.
|
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.
The SQL version of the pre-migration duplicate check needs a
psqlclient and adatabase password. A machine with only
gcloudhas neither, which is how thischeck stalled when it was needed.
This does the same counting through the Cloud SQL connector with IAM
authentication: the credential is the operator's own gcloud login, and nothing
is stored.
It reports, it does not resolve
Groups whose
valuedisagrees are conflicting measurements rather thanredundant rows. Collapsing them discards a reading somebody recorded, so which
copy survives is a judgement about the data and not something a script should
make.
The failure path is most of the value
A principal without a database user gets a Postgres error that reads exactly
like a wrong password:
so the script names the
gcloud sql users createcommand that fixes it. Thatmattered in practice — being a project owner does not imply a database login,
and the error does not say so.
Note that a user still needs
USAGEonpublicandSELECTontransducer_observation; creating the IAM user alone is not enough, and thatgrant needs someone who already has privileges.
Context
Written while checking #847's migration was safe to run. The check has since
come back clean for staging and production, and #847 is merged — this stays
because the next constraint migration will want it, and because it documents how
to query these databases from a machine with only gcloud.
🤖 Generated with Claude Code