Sobes.tech
Junior — Senior

Movie list processing pipeline

livecode

Task condition

Create a pipeline that processes a set of movies sequentially. The pipeline should perform two actions: first, sort the movies by their rating, and then exclude movies that are in the blacklist.


from dataclasses import dataclass

BLACK_LIST = ["Pirates of the Caribbean", 'Avengers']

@dataclass
class Film:
    title: str
    score: float

@dataclass
class FilmCollection:
    items: list[Film]

class Pipeline:
    def run(self, collection: FilmCollection) -> FilmCollection:
        pass