Skip to content

json_extract should use double quotes on Snowflake #103

@LewisDavies

Description

@LewisDavies

I'm using the Stripe package and have set project variables for fields I want to extract from metadata columns. It works on most values but isn't extracting anything when the key contains a full stop, e.g. plan.id.

I have fixed this locally by adding double quotes to the Snowflake macro:

{% macro snowflake__json_extract(string, string_path) %}

  json_extract_path_text(try_parse_json( {{string}} ), {{ "'\"" ~ string_path ~ "\"'" }} )

{% endmacro %}

Happy to make a PR but I'm not sure whether the problem applies to other databases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions