<@ULVA73B9P> These are the pull steps of my yaml f...
# ask-marvin
a
@Marvin These are the pull steps of my yaml file
Copy code
pull:
- prefect_aws.deployments.steps.pull_from_s3:
    bucket: my-bucket
    credentials: '{{ prefect.blocks.s3.my-bucket-credentials }}'
    folder: my-folder
    requires: prefect-aws
- prefect.deployments.steps.run_shell_script:
    script: pip install -e /python-flows
why am i getting this error:
ValueError: Step has unexpected additional keys: prefect_aws.deployments.steps.pull_from_s3
m
thought for 399.4 seconds
Thanks for sharing the snippet — the error is due to step structure. In Prefect 3.x, each step must be a single-key mapping where: - The single key is the fully qualified function path - Optional reserved keys like
id
,
requires
, and
if
live alongside that key (not inside the function’s parameter dict) In your YAML,
requires
is nested under the function’s parameters. That causes the step validator to see unexpected keys and raise:
ValueError: Step has unexpected additional keys: prefect_aws.deployments.steps.pull_from_s3
Here’s a corrected version:
Copy code
pull:
  - prefect_aws.deployments.steps.pull_from_s3:
      bucket: my-bucket
      folder: my-folder
      credentials: "{{ prefect.blocks.aws-credentials.my-bucket-credentials }}"
    requires: prefect-aws

  - prefect.deployments.steps.run_shell_script:
      script: pip install -e ./python-flows
Notes: - Move
requires
out to the same level as the step (as shown). - For AWS credentials, the block type is typically
aws-credentials
, so use
{{ prefect.blocks.aws-credentials.<your-block-slug> }}
. Your
prefect.blocks.s3...
path looks off. - Double-check the path in your
pip install -e
command. If the S3 contents land under
my-folder
, you may want
pip install -e ./my-folder/python-flows
unless your repo layout differs. Refs: - prefect.yaml structure - Pull steps API - Utility steps API If you’re still seeing the error after moving
requires
, please paste the full
pull:
section and confirm your Prefect version so I can help further.
a
@Marvin this is running prefect version 2.20.17
m
thought for 383.9 seconds
Got it — thanks for clarifying you’re on Prefect 2.20.17. In 2.x, the step syntax is slightly different than 3.x. In Prefect 2.x: - Each step is a list item where the single key is the step’s import path. - The values under that key include both the step’s parameters and the optional
id
and
requires
. Your structure is almost there; two things to fix/check: 1) Use the AWS credentials block type (
aws-credentials
), not
s3
, for the
credentials
field. 2) Ensure indentation is correct and each step is its own list item. Here’s a corrected 2.x example:
Copy code
pull:
  - prefect_aws.deployments.steps.pull_from_s3:
      id: pull_code
      requires: "prefect-aws>=0.3.4"
      bucket: "my-bucket"
      folder: "my-folder"
      credentials: "{{ prefect.blocks.aws-credentials.my-bucket-credentials }}"

  - prefect.deployments.steps.run_shell_script:
      script: "pip install -e ./python-flows"
      stream_output: true
Why you saw that error - Prefect raises “Step has unexpected additional keys: prefect_aws.deployments.steps.pull_from_s3” when a step’s mapping isn’t shaped as “one function key + its parameters (plus optional id/requires)”. This often happens due to indentation or mixing multiple step keys under one list item. Double-check that both steps have their own dash and that there are no tabs or misaligned spaces. Docs for Prefect 2.x - Steps + YAML: https://docs-2.prefect.io/latest/guides/prefect-deploy/ - AWS steps: https://docs-2.prefect.io/latest/integrations/prefect-aws/deployments/steps/ If it still errors, can you paste your full
pull:
section (as it appears in the file) and confirm the
prefect-aws
version installed in the runtime environment?