snowplow / dataflow-runner

Run templatable playbooks of Hadoop/Spark/et al jobs on Amazon EMR
http://snowplowanalytics.com
19 stars 8 forks source link

Replace hard-coded template name by the file name #28

Closed BenFradet closed 7 years ago

BenFradet commented 7 years ago

https://github.com/snowplow/dataflow-runner/blob/master/src/config_resolver.go#L210

t, err := template.New("playbook").Funcs(templFuncs).Parse(string(rawBytes))

generates an error that might be misleading.

e.g. if someone forgets to specify a template variable in cluster.json, the generated error will be:

template: playbook:1:10: executing "playbook" at <.var>: map has no entry for key "var"
BenFradet commented 7 years ago

I reckon the best template name would be the filename, what do you think @alexanderdean ?

alexanderdean commented 7 years ago

Yep agree! (Wow the original impl is confusing)

BenFradet commented 7 years ago

I just noticed it while writing the blog post :smile: