Better HN
topnewbestaskshowjobs
Log inSign up

Rickster35

3 karma · joined Jun 29, 2023 (3y ago) · 2 submissions

Submissions

comment 1y ago · link · parent

According to the docs, | is syntactic sugar for the .pipe method.

  pipeline = task(get_data, branch=True).pipe(
      task(step1, workers=20)).pipe(
      task(step2, workers=20)).pipe(
      task(step3, workers=20, multiprocess=True))
That's probably the chained method approach for those with this preference.

comment 1y ago · link · parent

Yeah, this seems neatest if you don't like line breaks

pipeline = (

    task(get_data, branch=True)

    | task(step1, workers=20)

    | task(step2, workers=20)

    | task(step3, workers=20, multiprocess=True)
)

Square brackets would create a list and braces would create a set of course. The contents still can be split over different lines-- just pointing that this syntax doesn't do the same thing.