fivetran / dbt_fivetran_utils

Helper utils for our packages
29 stars 19 forks source link

add find and replace to json extract #92

Closed fivetran-reneeli closed 1 year ago

fivetran-reneeli commented 1 year ago

What change does this PR introduce?

Add a find+replace to our pivot_json_extract macro, similar to `(' ', '_')` but with `('.', '_')`. **If this PR introduces a new macro, how did you test the new macro?**

n/a

If this PR introduces a modification to an existing macro, which packages is the macro currently present in and what steps were taken to test compatibility across packages?

Stripe Issue https://github.com/fivetran/dbt_stripe/issues/45 Testing with dbt compile -t snowflake -m stg_stripe__plan and dbt run -t snowflake -m stg_stripe__plan

Did you update the README to reflect the macro addition/modifications?

fivetran-reneeli commented 1 year ago

Hi @fivetran-joemarkiewicz , I updated the readmes in the stripe packages to reflect these new instructions. Let me know if they make sense! stripe stripe source

fivetran-joemarkiewicz commented 1 year ago

Thanks @fivetran-reneeli I noticed this PR didn't apply the updates to the macro. Would you be able to make those updates as well?

fivetran-reneeli commented 1 year ago

Test with the following packages.yml in dbt_stripe_source


packages:
# - package: fivetran/fivetran_utils
#   version: [">=0.4.0", "<0.5.0"]
- package: dbt-labs/spark_utils
  version: [">=0.3.0", "<0.4.0"]

- git: https://github.com/fivetran/dbt_fivetran_utils.git
  revision: bugfix/json_replace
  warn-unpinned: false
fivetran-reneeli commented 1 year ago

And adding this to the project yml:


    stripe__plan_metadata:
        - name: limit
          alias: limit_z
        - name: feature.id
          alias: feature_id
        - name: plan.handle
          alias: plan_handle
        - name: set
          alias: sets
        - name: 123
          alias: onetwothree
fivetran-reneeli commented 1 year ago

Hi @fivetran-joemarkiewicz , I made the updates and also updated the changelog and readmes and versioning. Lmk if it looks good!