Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Dataform: Error using @dataform/cli when running with "--dry-run" argument

Hi there!

I'm working on a Dataform project using the @dataform/cli (https://cloud.google.com/dataform/docs/use-dataform-cli) package. I want to run the "dataform run --dry-run" to check my final SQL. I every got the same error:

Dataform encountered an error: Unexpected property "type", or property value type of "string" is incorrect.
ReferenceError: Unexpected property "type", or property value type of "string" is incorrect.

I can compile my project without errors ("dataform compile"), but with "dataform run --dry-run", I'm getting stuck.

Can anyone know what the problem is?

@dataform/cli version: 3.0.2
@dataform/core version: 3.0.0

 

0 1 756
1 REPLY 1

Hi @liviag,

Welcome to Google Cloud Community!

The error “Unexpected property ”type”, or property value type of “string” is incorrect” suggests there’s an issue with the structure of your Dataform configurations or sqlx files. Dataform expects specific properties and data types, and any deviation can cause this error during the dataform run command.

Here’s the workaround that you can do:

  • Check your project’s config.json file for any potential type mismatches. Pay close attention to properties like defaultDatabase, defaultSchema and any custom variables you’ve defined
  • Check all the data types defined in your schema files adhere to valid JSON schema types.
  • Ensure that any JavaScript expressions embedded in your SQLX files are valid.

I hope the above information is helpful.