Docstrings and typing.
This commit is contained in:
parent
26d1f10a00
commit
910373f19c
1 changed files with 8 additions and 1 deletions
|
|
@ -43,7 +43,14 @@ def connect_to_trino(
|
||||||
|
|
||||||
|
|
||||||
@task(trigger=all_finished)
|
@task(trigger=all_finished)
|
||||||
def close_trino_connection(trino_connection: trino.dbapi.Connection):
|
def close_trino_connection(trino_connection: trino.dbapi.Connection) -> None:
|
||||||
|
"""
|
||||||
|
Close a Trino connection, or do nothing if what has been passed is not a
|
||||||
|
Trino connection.
|
||||||
|
|
||||||
|
:param trino_connection: a trino connection.
|
||||||
|
:return: None
|
||||||
|
"""
|
||||||
logger = prefect.context.get("logger")
|
logger = prefect.context.get("logger")
|
||||||
if isinstance(trino_connection, trino.dbapi.Connection):
|
if isinstance(trino_connection, trino.dbapi.Connection):
|
||||||
trino_connection.close()
|
trino_connection.close()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue