SFDO-Tooling / Snowfakery

A tool for generating fake data that has relations between tables.
BSD 3-Clause "New" or "Revised" License
141 stars 32 forks source link

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

Open mdykemanSF opened 6 months ago

mdykemanSF commented 6 months ago

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