Skip to content

Commit

Permalink
move agate_helper into common
Browse files Browse the repository at this point in the history
  • Loading branch information
MichelleArk committed Oct 25, 2023
1 parent dbd02e5 commit f44d704
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion core/dbt/adapters/base/impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
)

from dbt.adapters.protocol import AdapterConfig
from dbt.clients.agate_helper import (
from dbt.common.clients.agate_helper import (
empty_table,
get_column_value_uncased,
merge_tables,
Expand Down
6 changes: 3 additions & 3 deletions core/dbt/adapters/sql/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import agate

import dbt.clients.agate_helper
import dbt.common.clients.agate_helper
import dbt.exceptions
from dbt.adapters.base import BaseConnectionManager
from dbt.adapters.contracts.connection import Connection, ConnectionState, AdapterResponse
Expand Down Expand Up @@ -129,7 +129,7 @@ def get_result_from_cursor(cls, cursor: Any, limit: Optional[int]) -> agate.Tabl
rows = cursor.fetchall()
data = cls.process_results(column_names, rows)

return dbt.clients.agate_helper.table_from_data_flat(data, column_names)
return dbt.common.clients.agate_helper.table_from_data_flat(data, column_names)

Check warning on line 132 in core/dbt/adapters/sql/connections.py

View check run for this annotation

Codecov / codecov/patch

core/dbt/adapters/sql/connections.py#L132

Added line #L132 was not covered by tests

def execute(
self, sql: str, auto_begin: bool = False, fetch: bool = False, limit: Optional[int] = None
Expand All @@ -140,7 +140,7 @@ def execute(
if fetch:
table = self.get_result_from_cursor(cursor, limit)
else:
table = dbt.clients.agate_helper.empty_table()
table = dbt.common.clients.agate_helper.empty_table()
return response, table

def add_begin_query(self):
Expand Down
Empty file.
File renamed without changes.
2 changes: 1 addition & 1 deletion core/dbt/context/providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

from dbt.adapters.base.column import Column
from dbt.adapters.factory import get_adapter, get_adapter_package_names, get_adapter_type_names
from dbt.clients import agate_helper
from dbt.common.clients import agate_helper
from dbt.clients.jinja import get_rendered, MacroGenerator, MacroStack
from dbt.config import RuntimeConfig, Project
from dbt.constants import SECRET_ENV_PREFIX, DEFAULT_ENV_PLACEHOLDER
Expand Down
2 changes: 1 addition & 1 deletion core/dbt/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2245,7 +2245,7 @@ def __init__(self, yaml_columns, sql_columns):

def get_mismatches(self) -> agate.Table:
# avoid a circular import
from dbt.clients.agate_helper import table_from_data_flat
from dbt.common.clients.agate_helper import table_from_data_flat

Check warning on line 2248 in core/dbt/exceptions.py

View check run for this annotation

Codecov / codecov/patch

core/dbt/exceptions.py#L2248

Added line #L2248 was not covered by tests

column_names = ["column_name", "definition_type", "contract_type", "mismatch_reason"]
# list of mismatches
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import os
from shutil import rmtree
from tempfile import mkdtemp
from dbt.clients import agate_helper
from dbt.common.clients import agate_helper

SAMPLE_CSV_DATA = """a,b,c,d,e,f,g
1,n,test,3.2,20180806T11:33:29.320Z,True,NULL
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_postgres_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from dbt.adapters.postgres import Plugin as PostgresPlugin
from dbt.contracts.files import FileHash
from dbt.contracts.graph.manifest import ManifestStateCheck
from dbt.clients import agate_helper
from dbt.common.clients import agate_helper
from dbt.exceptions import DbtValidationError, DbtConfigError
from psycopg2 import extensions as psycopg2_extensions
from psycopg2 import DatabaseError
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ def generate_name_macros(package):

class TestAdapterConversions(TestCase):
def _get_tester_for(self, column_type):
from dbt.clients import agate_helper
from dbt.common.clients import agate_helper

if column_type is agate.TimeDelta: # dbt never makes this!
return agate.TimeDelta()
Expand Down

0 comments on commit f44d704

Please sign in to comment.