snowshu.adapters.source_adapters.base_source_adapter¶
-
class
snowshu.adapters.source_adapters.base_source_adapter.BaseSourceAdapter(preserve_case: bool = False)¶ Bases:
snowshu.adapters.base_sql_adapter.BaseSQLAdapter-
DEFAULT_CASE= 'lower'¶
-
MAX_ALLOWED_DATABASES= 2000¶
-
MAX_ALLOWED_ROWS= 1000000¶
-
SUPPORTED_FUNCTIONS= {}¶
-
SUPPORTS_CROSS_DATABASE= False¶
-
build_catalog(patterns: Iterable[dict], thread_workers: int = 1) → Tuple[snowshu.core.models.relation.Relation]¶ This function is expected to return all of the relations that satisfy the filters
- Parameters
patterns (Iterable[dict]) – Filter dictionaries to apply to the source databases requires “database”, “schema”, and “name” keys
thread_workers (int) – The number of workers to use when building the catalog
- Returns
All of the relations from the source adapter pass the filters
- Return type
Tuple[Relation]
-
check_count_and_query(query: str, max_count: int) → pandas.core.frame.DataFrame¶ checks the count, if count passes returns results as a dataframe.
-
name= ''¶
-
scalar_query(query: str) → Any¶ Returns only a single value.
When the database is expected to return a single row with a single column, this method will return the raw value from that cell. Will throw a
TooManyRecordsexception.- Parameters
query – the query to execute.
- Returns
the raw value from cell [0][0]
-