Skip to content

Commit

Permalink
Fix GET step run endpoint to return unhydrated response if requested
Browse files Browse the repository at this point in the history
  • Loading branch information
schustmi committed Dec 4, 2024
1 parent 3812ca5 commit 42fc70b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/zenml/zen_server/routers/steps_endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,16 @@ def get_step(
Returns:
The step.
"""
step = zen_store().get_run_step(step_id, hydrate=hydrate)
# We always fetch the step hydrated because we need the pipeline_run_id
# for the permission checks. If the user requested an unhydrated response,
# we later remove the metadata
step = zen_store().get_run_step(step_id, hydrate=True)
pipeline_run = zen_store().get_run(step.pipeline_run_id)
verify_permission_for_model(pipeline_run, action=Action.READ)

if hydrate is False:
step.metadata = None

return dehydrate_response_model(step)


Expand Down

0 comments on commit 42fc70b

Please sign in to comment.