From 4ba1b4c007e54bcf09c0a71fd9a39c5a9bded9e1 Mon Sep 17 00:00:00 2001 From: Pablo Martin Date: Mon, 24 Apr 2023 13:55:29 +0200 Subject: [PATCH] Improve docstrings --- lolafect/utils.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lolafect/utils.py b/lolafect/utils.py index 2aa82a0..2b7e460 100644 --- a/lolafect/utils.py +++ b/lolafect/utils.py @@ -30,8 +30,8 @@ class S3FileReader: def begin_sql_transaction(connection: Any) -> None: """ Start a SQL transaction in the passed connection. The task is agnostic to - the SQL engine being used. As long as it implements a begin() method, this - will work. + the SQL engine being used. As long as the connection object implements a + begin() method, this task will work. :param connection: the connection to some database. :return: None @@ -45,10 +45,13 @@ def begin_sql_transaction(connection: Any) -> None: def end_sql_transaction(connection: Any, dry_run: bool = False) -> None: """ Finish a SQL transaction, either by rolling it back or by committing it. + The task is agnostic to the SQL engine being used. As long as the + connection object implements a `commit` and a `rollback` method, this task + will work. :param connection: the connection to some database. :param dry_run: a flag indicating if persistence is desired. If dry_run - is True, changes will be rolledback. + is True, changes will be rolledback. Otherwise, they will be committed. :return: None """ logger = prefect.context.get("logger")