Feature/simpl 24306
This commit is contained in:
0
src/template-code-location/__init__.py
Normal file
0
src/template-code-location/__init__.py
Normal file
0
src/template-code-location/jobs/__init__.py
Normal file
0
src/template-code-location/jobs/__init__.py
Normal file
9
src/template-code-location/jobs/jobs.py
Normal file
9
src/template-code-location/jobs/jobs.py
Normal file
@@ -0,0 +1,9 @@
|
||||
from dagster import job
|
||||
from ..ops.ops import fetch_data, process_data
|
||||
|
||||
|
||||
@job
|
||||
def data_processing_job():
|
||||
"""A simple job that fetches and processes data."""
|
||||
raw = fetch_data()
|
||||
process_data(raw)
|
||||
0
src/template-code-location/ops/__init__.py
Normal file
0
src/template-code-location/ops/__init__.py
Normal file
13
src/template-code-location/ops/ops.py
Normal file
13
src/template-code-location/ops/ops.py
Normal file
@@ -0,0 +1,13 @@
|
||||
from dagster import op
|
||||
|
||||
|
||||
@op
|
||||
def fetch_data() -> list:
|
||||
"""Fetches raw data from a source."""
|
||||
return [{"id": 1, "value": "A"}, {"id": 2, "value": "B"}]
|
||||
|
||||
|
||||
@op
|
||||
def process_data(data: list) -> dict:
|
||||
"""Processes raw data and returns a summary."""
|
||||
return {"count": len(data), "status": "success"}
|
||||
6
src/template-code-location/repository.py
Normal file
6
src/template-code-location/repository.py
Normal file
@@ -0,0 +1,6 @@
|
||||
from dagster import Definitions
|
||||
from .jobs.jobs import data_processing_job
|
||||
|
||||
defs = Definitions(
|
||||
jobs=[data_processing_job],
|
||||
)
|
||||
Reference in New Issue
Block a user