google-cloud-platformgclouddataform

"Dataform encountered an error: Unexpected property "type", or property value type of "string" is incorrect." using @dataform/cli


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?


Solution

  • I found the solution, I ran this command dataform init-creds and later it generated a .df-credentials.json file in my project directory like this:

    {
    "projectId": "project",
    "location": "location"
    }
    

    When you run the command you will be prompted to choose these options:

    $ dataform init-creds
    
    [1] US (default)
    [2] EU
    [3] other
    
    Enter the location of your datasets [1, 2, 3]: 2
    
    [1] ADC (default)
    [2] JSON Key
    
    Do you wish to use Application Default Credentials or JSON Key [1/2]: 1
    Enter your billing project ID:
    > 
    

    I hope this helps!