Skip to content

Update Mode Statement Count Check Does Not Specify "Objects" #1020

@mdykemanSF

Description

@mdykemanSF

When updating sObjects in Salesforce, Snowfakery performs a count check of statements in parse_recipe_yaml.py:753

error_message = "Update recipes should have a single object declaration."
    if len(statements) != 1:
        raise exc.DataGenSyntaxError(error_message)

However, no check is performed here to limit this to object statements.

The YAML

- snowfakery_version: 3
- var: snowfakery_locale
  value: en_US

- object: Contact
  fields:
    MobilePhone: ${{fake.BasicPhoneNumber}}
    HomePhone: ${{fake.BasicPhoneNumber}}

results in the error Error: Update recipes should have a single object declaration.
because the list of statements also contains a variable, despite the recipe only containing a single object

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions