Improve docstrings

This commit is contained in:
Pablo Martin 2023-04-24 13:55:29 +02:00
parent 9201c236af
commit 4ba1b4c007

View file

@ -30,8 +30,8 @@ class S3FileReader:
def begin_sql_transaction(connection: Any) -> None: def begin_sql_transaction(connection: Any) -> None:
""" """
Start a SQL transaction in the passed connection. The task is agnostic to 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 the SQL engine being used. As long as the connection object implements a
will work. begin() method, this task will work.
:param connection: the connection to some database. :param connection: the connection to some database.
:return: None :return: None
@ -45,10 +45,13 @@ def begin_sql_transaction(connection: Any) -> None:
def end_sql_transaction(connection: Any, dry_run: bool = False) -> 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. 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 connection: the connection to some database.
:param dry_run: a flag indicating if persistence is desired. If dry_run :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 :return: None
""" """
logger = prefect.context.get("logger") logger = prefect.context.get("logger")