From b8cf4be80128a399340b916915ab033f078ab92c Mon Sep 17 00:00:00 2001 From: Peter Allen Webb Date: Tue, 16 Jul 2024 17:23:38 -0400 Subject: [PATCH] Add docstrings --- dbt/adapters/postgres/record/cursor/cursor.py | 2 ++ dbt/adapters/postgres/record/handle.py | 3 +++ 2 files changed, 5 insertions(+) diff --git a/dbt/adapters/postgres/record/cursor/cursor.py b/dbt/adapters/postgres/record/cursor/cursor.py index fc13e3c..a7edfe2 100644 --- a/dbt/adapters/postgres/record/cursor/cursor.py +++ b/dbt/adapters/postgres/record/cursor/cursor.py @@ -6,6 +6,8 @@ class PostgresRecordReplayCursor(RecordReplayCursor): + """A custom extension of RecordReplayCursor that adds the statusmessage + property which is specific to psycopg.""" @property @record_function(CursorGetStatusMessageRecord, method=True, id_field_name="connection_name") def statusmessage(self): diff --git a/dbt/adapters/postgres/record/handle.py b/dbt/adapters/postgres/record/handle.py index c6a589a..d75e0e2 100644 --- a/dbt/adapters/postgres/record/handle.py +++ b/dbt/adapters/postgres/record/handle.py @@ -3,6 +3,9 @@ from dbt.adapters.postgres.record.cursor.cursor import PostgresRecordReplayCursor class PostgresRecordReplayHandle(RecordReplayHandle): + """A custom extension of RecordReplayHandle that returns + a psycopg-specific PostgresRecordReplayCursor object.""" + def cursor(self): cursor = None if self.native_handle is None else self.native_handle.cursor() return PostgresRecordReplayCursor(cursor, self.connection)