Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
get_column_schema_from_query documentation
  • Loading branch information
MichelleArk committed Feb 22, 2023
commit e1ed7139dc33b70914bd7c8a2c536ce3e93b10aa
13 changes: 4 additions & 9 deletions core/dbt/adapters/base/impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,17 +270,12 @@ def execute(
return self.connections.execute(sql=sql, auto_begin=auto_begin, fetch=fetch)

@available.parse(lambda *a, **k: [])
def get_column_schema_from_query(
self, sql: str, auto_begin: bool = False, fetch: bool = False
) -> List[Tuple[str, Any]]:
"""Get a list of the column names and data types in the given Relation.
def get_column_schema_from_query(self, sql: str) -> List[Tuple[str, Any]]:
"""Get a list of the column names and data types from the given sql.

:param str sql: The sql to execute.
:param bool auto_begin: If set, and dbt is not currently inside a
transaction, automatically begin one.
:param bool fetch: If set, fetch results.
:return: A tuple of the query status and results (empty if fetch=False).
:rtype: List[(column_name: str, data_type: Any]
:return: A tuple of column schema attributes (column_name: str, data_type: Any), which can be used to construct a Column object.
:rtype: List[(column_name: str, data_type: Any)]
"""
return self.connections.get_column_schema_from_query(sql=sql)

Expand Down