最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Read Dataform config block to JSON5 - Stack Overflow

programmeradmin0浏览0评论

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?

发布评论

评论列表(0)

  1. 暂无评论