admin管理员组

文章数量:1356477

I often use variables in the Dataform config key, such as env.rawDataProject here:

config {
  type: "declaration",
  database: env.rawDataProject,
  schema: "raw_sales",
  description: "Raw sales data, ingested daily"
}

I want to automatically format the Dataform config{} blocks as part of my dev pipeline and it seems possible as the config{} block is almost compliant JSON5 (JSON with unquoted keys).

However unquoted variables like the above stop the default Python JSON5 parser library from working, as JSON5 values must be string quoted. I've tried:

database: "${env.rawDataProject}",

which does parse successfully with the JSON5 Python library, but Dataform reads this as a literal string and does no substitution.

Are there any solutions here?

本文标签: Read Dataform config block to JSON5Stack Overflow