Intermediate developers looking to master advanced data routing, alerts, and side-output tag collections.
Calculate total stock valuation and identify low stock items.
Save the following raw rows locally as \`dataset.csv\` to test your pipeline:
item_code,name,stock_level,unit_cost
item1,Widget A,150,2.50
item2,Widget B,40,12.00
item3,Widget C,8,45.00
item4,Widget D,120,1.25
item5,Widget E,5,80.00Create a local file named \`starter.py\` and copy the following skeleton. Complete the missing transformations:
# starter.py - Inventory Analytics
import apache_beam as beam
from apache_beam.options.pipeline_options import PipelineOptions
def run_pipeline():
options = PipelineOptions()
with beam.Pipeline(options=options) as p:
# TODO: Calculate values
# TODO: Separate low stock items using dynamic routing
# TODO: Output inventory reports
pass
if __name__ == "__main__":
run_pipeline()