From b4eb52d856f560b0df6567087e93c247ce25263e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edgar=20Ram=C3=ADrez=20Mondrag=C3=B3n?= Date: Tue, 3 Dec 2024 10:08:12 -0600 Subject: [PATCH] fix: Exclude `information_schema` and `pg_catalog` from discovery --- tap_postgres/tap.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tap_postgres/tap.py b/tap_postgres/tap.py index 0e1e48f..4cdab8a 100644 --- a/tap_postgres/tap.py +++ b/tap_postgres/tap.py @@ -42,6 +42,11 @@ class TapPostgres(SQLTap): name = "tap-postgres" default_stream_class = PostgresStream + exclude_schemas = ( + "information_schema", + "pg_catalog", + ) + def __init__( self, *args, @@ -547,7 +552,11 @@ def catalog_dict(self) -> dict: return self.input_catalog.to_dict() result: dict[str, list[dict]] = {"streams": []} - result["streams"].extend(self.connector.discover_catalog_entries()) + result["streams"].extend( + self.connector.discover_catalog_entries( + exclude_schemas=self.exclude_schemas, + ) + ) self._catalog_dict: dict = result return self._catalog_dict