Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make pipelines able to run and load data and check errors from dynamic context #150

Open
lisad opened this issue Jun 22, 2024 · 0 comments

Comments

@lisad
Copy link
Owner

lisad commented Jun 22, 2024

I started to write documentation for install.md, and found a couple things I really wanted to do for an example, but the library can't do yet.

  • Loading data: it should be possible to build the pipeline into HTTP views, so that the request.body is treated as data fort he pipeline.
  • Checking errors: it should be possible to check the whole pipeline for errors e.g. for the use case below.
  • Output: I didn't even get to this part... in the example of the pipeline running in response to an HTTP request, how does the pipeline's output get into the db.
from phaser import Pipeline, Phase, row_step

@row_step
def my_step(row):
    row['pudding'] = 'proof'

my_pipeline = Pipeline(
    phases = [
        Phase(steps=[my_step])
    ]
)

def my_import_data_view(request):
    data = request.body
    my_pipeline.load(data)
    my_pipeline.run()
    if my_pipeline.context.has_errors():
        return HttpResponse(status=401)
    else:
        return HttpResponse(status=200)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant