Skip to content

Commit

Permalink
Fix run query method name
Browse files Browse the repository at this point in the history
  • Loading branch information
svdimchenko committed Aug 3, 2023
1 parent af8c9c7 commit 829a9ff
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dbt/adapters/athena/impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,7 @@ def is_list(self, value: Any) -> bool:
return isinstance(value, list)

@available
def safe_run_query(self, sql: str) -> str:
def run_query_with_partitions_limit_catching(self, sql: str) -> str:
conn = self.connections.get_thread_connection()
cursor = conn.handle.cursor()
try:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
);
{%- endset -%}

{%- set query_result = adapter.safe_run_query(insert_full) -%}
{%- set query_result = adapter.run_query_with_partitions_limit_catching(insert_full) -%}
{%- do log('QUERY RESULT: ' ~ query_result) -%}
{%- if query_result == 'TOO_MANY_OPEN_PARTITIONS' -%}
{% set partitions_batches = get_partition_batches(tmp_relation) %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
{{ merge_part }}
{%- endset -%}

{%- set query_result = adapter.safe_run_query(merge_full) -%}
{%- set query_result = adapter.run_query_with_partitions_limit_catching(merge_full) -%}
{%- do log('QUERY RESULT: ' ~ query_result) -%}
{%- if query_result == 'TOO_MANY_OPEN_PARTITIONS' -%}
{% set partitions_batches = get_partition_batches(tmp_relation) %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
{%- endmacro %}

{% macro safe_create_table_as(temporary, relation, sql) -%}
{%- set query_result = adapter.safe_run_query(create_table_as(temporary, relation, sql)) -%}
{%- set query_result = adapter.run_query_with_partitions_limit_catching(create_table_as(temporary, relation, sql)) -%}
{%- do log('QUERY RESULT: ' ~ query_result) -%}
{%- if query_result == 'TOO_MANY_OPEN_PARTITIONS' -%}
{%- do create_table_as_with_partitions(temporary, relation, sql) -%}
Expand Down

0 comments on commit 829a9ff

Please sign in to comment.