ENG-2635: Support namespaces for Postgres DSR execution#7500
Open
ENG-2635: Support namespaces for Postgres DSR execution#7500
Conversation
Add PostgresNamespaceMeta schema and wire namespace support through PostgresQueryConfig, PostgreSQLConnector, and RDSPostgresConnector. Remove stubbed retrieve_data/mask_data from RDSPostgresConnector so it inherits SQLConnector's implementations, enabling DSR execution. Update RDS Postgres admin UI tags to include "DSR Automation". Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Guard against None secrets in NamespaceMetaValidationStep. Update test_validate_unsupported_connection_type to use mariadb (postgres is now a supported namespace type). Add Postgres-specific validation tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Postgres defaults to the public schema when neither namespace_meta nor db_schema is configured. Return empty fallback fields so validation doesn't reject existing postgres connections that lack both. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove extra parentheses around bind parameters in expected query strings to match current SQLAlchemy output format. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The dry-run query test passes db=None to TaskResources, which flows into query_config() -> get_namespace_meta(). Return None early when no db session is available. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When a dataset's namespace_meta has no overlapping fields with the connection type's namespace schema (e.g. BigQuery namespace_meta on a Postgres connection), skip validation rather than raising an error. This happens when datasets of mixed types are bulk-linked to a single connection. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Greptile SummaryThis PR adds namespace support for Postgres and RDS Postgres connectors, enabling a single connection to handle multiple schemas for DSR execution. The implementation follows the established Snowflake/BigQuery pattern exactly. Key Changes:
Backward Compatibility:
Impact: Confidence Score: 5/5
Important Files Changed
Last reviewed commit: 8b9718d |
JadeCara
pushed a commit
that referenced
this pull request
Feb 26, 2026
Add GoogleCloudSQLPostgresNamespaceMeta with database_name (optional) and schema (required), following the same pattern as Snowflake/BigQuery. Update GoogleCloudSQLPostgresQueryConfig with generate_table_name() for schema-qualified SQL, and GoogleCloudSQLPostgresConnector to fetch namespace_meta from DB and pass it to the query config. Also includes shared fixes from PR #7500: - Guard against None db session in get_namespace_meta - Guard against None secrets in namespace validation - Skip namespace validation for mismatched connection types Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
18 tasks
JadeCara
pushed a commit
that referenced
this pull request
Feb 26, 2026
Add GoogleCloudSQLPostgresNamespaceMeta with database_name (optional) and schema (required), following the same pattern as Snowflake/BigQuery. Update GoogleCloudSQLPostgresQueryConfig with generate_table_name() for schema-qualified SQL, and GoogleCloudSQLPostgresConnector to fetch namespace_meta from DB and pass it to the query config. Also includes shared fixes from PR #7500: - Guard against None db session in get_namespace_meta - Guard against None secrets in namespace validation - Skip namespace validation for mismatched connection types Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
10 tasks
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.
Ticket ENG-2635
Description Of Changes
Add namespace support for Postgres connectors, enabling a single connection to handle multiple schemas for DSR execution. This follows the established Snowflake/BigQuery pattern exactly.
Ramp has 200-300 datasets representing different Postgres schemas. Previously, each schema required a separate integration for DSRs. With namespace support, a single Postgres connection can execute DSRs across all schemas by using fully-qualified table names (
"schema"."table"or"database"."schema"."table").This also removes the stubbed
retrieve_data()/mask_data()fromRDSPostgresConnector, unblocking DSR execution for RDS Postgres connections.PR 1 of 3 — Core Postgres + RDS Postgres namespace support. Google Cloud SQL Postgres (PR 2) and
set_schema()reconciliation (PR 3) follow separately.Code Changes
src/fides/api/schemas/namespace_meta/postgres_namespace_meta.py— NewPostgresNamespaceMetaschema withdatabase_name(optional) andschema(required), auto-registered viaNamespaceMeta.__init_subclass__. Returns empty fallback fields for backward compat (Postgres defaults to public schema).src/fides/api/service/connectors/query_configs/postgres_query_config.py— Addednamespace_meta_schema,generate_table_name()for schema-qualified SQL, updatedget_formatted_query_string()andget_update_stmt()to use itsrc/fides/api/service/connectors/postgres_connector.py—query_config()now fetches namespace_meta from DB, addedget_qualified_table_name()for unquoted names in error handlingsrc/fides/api/service/connectors/rds_postgres_connector.py— Removed stubbedretrieve_data()/mask_data()(inheritsSQLConnector's implementations),query_config()passes namespace_meta, addedget_qualified_table_name()src/fides/api/service/connectors/sql_connector.py— AddedNoneguard inget_namespace_meta()for dry-run contexts where no DB session is availablesrc/fides/service/dataset/validation_steps/namespace_meta.py— AddedNoneguard for connection secrets; skip namespace validation when namespace_meta fields don't overlap with the connection type's schema (cross-type dataset linking)clients/admin-ui/src/features/integrations/integration-type-info/rdsPostgresInfo.tsx— Added "DSR Automation" to RDS Postgres tagstests/ops/service/connectors/test_postgres_query_config.py— New tests mirroring Snowflake test structure: parametrized namespace query generation, invalid meta validation, namespaced update statementstests/service/dataset_service/test_namespace_meta_validation.py— Updated for Postgres namespace support: 5 new Postgres-specific tests, cross-type namespace skip test, updated unsupported type testSteps to Confirm
1. Run namespace query config tests
Expected: All 9 tests pass (5 parametrized query generation, 1 invalid meta, 3 update statements).
2. Run namespace validation tests
Expected: All 15 tests pass, including 5 Postgres-specific and 1 cross-type namespace skip test.
3. Verify backward compatibility (no namespace = no breakage)
Expected: Existing Postgres query config tests pass unchanged — datasets without
namespace_metaproduce unqualified table names as before.4. Verify dataset creation with namespace_meta via API
Create a Postgres connection, then create a dataset with
namespace_meta, and link it:Expected: All return 200/201. The
datasetconfigresponse shows"succeeded": [...]with 1 entry.5. Verify namespace_meta is persisted and returned
Expected: The response includes
"fides_meta": {"namespace": {"schema": "billing"}}in thectl_datasetof the linked dataset config.6. Verify backward compat via API (no namespace_meta required for Postgres)
Expected: Both return 200/201 — no validation error. Postgres connections do NOT require namespace_meta (backward compatible, defaults to public schema).
7. Check RDS Postgres Admin UI tag
Navigate to the Integrations page in the Admin UI and find "RDS Postgres".
Expected: RDS Postgres shows "DSR Automation", "Discovery", and "Detection" tags.
Pre-Merge Checklist
CHANGELOG.mdupdatedmaindowngrade()migration is correct and works🤖 Generated with Claude Code