data-mie / dbt-profiler

Macros for generating dbt model data profiles
Apache License 2.0
81 stars 33 forks source link

Suggestion to modify `sed` to `awk` in update-relation-profile.sh #72

Closed ian-lewis-d closed 1 year ago

ian-lewis-d commented 1 year ago

https://github.com/data-mie/dbt-profiler/blob/5c7002eaa3a8947756c223422b147b02a516bd90/update-relation-profile.sh#L14

Current: PROFILE=$(echo "$RUN_OPERATION_OUTPUT" | sed -n '/{% docs/,$p')

Suggested replacement:

PROFILE=$(echo "$RUN_OPERATION_OUTPUT" | awk '/{%.docs.*%}$/{flag=1} flag; /{%.enddocs.%}/{flag=0}')

stumelius commented 1 year ago

@ian-lewis-d Thanks so much for this! I never liked the hacky sed I came up with, this works much better :) Merged in #73