Improved code example
This commit is contained in:
parent
e355e771b0
commit
ee489edd61
1 changed files with 6 additions and 2 deletions
|
|
@ -41,11 +41,15 @@ lolaconfig = build_lolaconfig(
|
||||||
```python
|
```python
|
||||||
from lolafect.connections import connect_to_trino, close_trino_connection
|
from lolafect.connections import connect_to_trino, close_trino_connection
|
||||||
|
|
||||||
|
with Flow(...) as flow:
|
||||||
connection = connect_to_trino.run(
|
connection = connect_to_trino.run(
|
||||||
trino_credentials=my_trino_credentials #You can probably try to fetch this from lolaconfig.TRINO_CREDENTIALS
|
trino_credentials=my_trino_credentials #You can probably try to fetch this from lolaconfig.TRINO_CREDENTIALS
|
||||||
)
|
)
|
||||||
connection.cursor().execute("SELECT 1")
|
task_result = some_trino_related_task(trino_connection=connection)
|
||||||
close_trino_connection.run(trino_connection=connection)
|
close_trino_connection.run(
|
||||||
|
trino_connection=connection,
|
||||||
|
upstream_tasks=[task_result]
|
||||||
|
)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue