Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions airflow/example_dags/tutorial_objectstorage.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
# [END create_object_storage_path]


# [START instantiate_dag]
@dag(
schedule=None,
start_date=pendulum.datetime(2021, 1, 1, tz="UTC"),
Expand All @@ -62,9 +61,6 @@ def tutorial_objectstorage():
located
[here](https://airflow.apache.org/docs/apache-airflow/stable/tutorial/objectstorage.html)
"""
# [END instantiate_dag]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This wasn't used

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also remove start :) ?

import duckdb
import pandas as pd

# [START get_air_quality_data]
@task
Expand All @@ -74,6 +70,8 @@ def get_air_quality_data(**kwargs) -> ObjectStoragePath:
This task gets air quality data from the Finnish Meteorological Institute's
open data API. The data is saved as parquet.
"""
import pandas as pd

execution_date = kwargs["logical_date"]
start_time = kwargs["data_interval_start"]

Expand Down Expand Up @@ -113,6 +111,8 @@ def analyze(path: ObjectStoragePath, **kwargs):
#### Analyze
This task analyzes the air quality data, prints the results
"""
import duckdb

conn = duckdb.connect(database=":memory:")
conn.register_filesystem(path.fs)
conn.execute(f"CREATE OR REPLACE TABLE airquality_urban AS SELECT * FROM read_parquet('{path}')")
Expand Down