Skip to content

Commit

Permalink
refactor get_fixture_sql
Browse files Browse the repository at this point in the history
  • Loading branch information
MichelleArk committed Feb 9, 2024
1 parent c8b1f7f commit f9c1080
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,15 @@ union all

{%- set column_type = column_name_to_data_types[column_name] %}

{#-- wrap yaml strings in quotes, apply cast --#}
{#-- sanitize column_value: wrap yaml strings in quotes, apply cast --#}
{%- set column_value_clean = column_value -%}
{%- if column_value is string -%}
{%- set row_update = {column_name: safe_cast(dbt.string_literal(dbt.escape_single_quotes(column_value)), column_type) } -%}
{%- set column_value_clean = dbt.string_literal(dbt.escape_single_quotes(column_value)) -%}
{%- elif column_value is none -%}
{%- set row_update = {column_name: safe_cast('null', column_type) } -%}
{%- else -%}
{%- set row_update = {column_name: safe_cast(column_value, column_type) } -%}
{%- set column_value_clean = 'null' } -%}
{%- endif -%}

{%- set row_update = {column_name: safe_cast(column_value_clean, column_type) } -%}
{%- do formatted_row.update(row_update) -%}
{%- endfor -%}
{{ return(formatted_row) }}
Expand Down
1 change: 0 additions & 1 deletion dbt/tests/adapter/unit_testing/test_case_insensitivity.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import pytest
from dbt.tests.util import run_dbt
from dbt.tests.fixtures.project import *


my_model_sql = """
Expand Down
1 change: 0 additions & 1 deletion dbt/tests/adapter/unit_testing/test_invalid_input.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import pytest
from dbt.tests.util import run_dbt, run_dbt_and_capture
from dbt.tests.fixtures.project import *


my_model_sql = """
Expand Down
1 change: 0 additions & 1 deletion dbt/tests/adapter/unit_testing/test_types.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import pytest

from dbt.tests.util import write_file, run_dbt
from dbt.tests.fixtures.project import *

my_model_sql = """
select
Expand Down

0 comments on commit f9c1080

Please sign in to comment.