1616from typing import List
1717from contextlib import contextmanager
1818from dbt .tests .util import AnyInteger
19+ import os
1920
2021from dbt .adapters .events .logging import AdapterLogger
2122
2223logger = AdapterLogger ("dremio" )
2324
2425# Ensure we do not include dashes in our source
2526# https://github.com/dremio/dbt-dremio/issues/68
26- BUCKET = "dbtdremios3"
27- SOURCE = "dbt_test_source"
27+ # Use environment variable if present, otherwise use default value
28+ BUCKET = os .environ .get ("DBT_DREMIO_S3_BUCKET" , "dbtdremios3" )
29+ SOURCE = os .environ .get ("DBT_DREMIO_S3_SOURCE" , "dbt_test_source" )
2830
2931
3032class TestProcessingException (Exception ):
@@ -55,15 +57,15 @@ def relation_from_name(adapter, name: str, materialization=""):
5557 relation_parts .insert (0 , credentials .datalake )
5658 if credentials .root_path not in [None , "no_schema" ]:
5759 relation_parts .insert (1 , credentials .root_path )
58-
60+
5961
6062 relation_type = "table" if materialization != "view" and "view" not in name else "view"
6163
6264 schema = "." .join (relation_parts [1 :- 1 ])
6365
6466 kwargs = {
6567 "database" : relation_parts [0 ],
66- "schema" : None if schema == "" else schema ,
68+ "schema" : None if schema == "" else schema ,
6769 "identifier" : relation_parts [- 1 ],
6870 "type" : relation_type ,
6971 }
@@ -83,7 +85,7 @@ def get_connection(adapter, name="_test"):
8385 yield conn
8486
8587# Overwrite the default implementation to use this adapter's
86- # relation_from_name function.
88+ # relation_from_name function.
8789def get_relation_columns (adapter , name ):
8890 relation = relation_from_name (adapter , name )
8991 with get_connection (adapter ):
@@ -92,7 +94,7 @@ def get_relation_columns(adapter, name):
9294
9395
9496# Overwrite the default implementation to use this adapter's
95- # relation_from_name function.
97+ # relation_from_name function.
9698def check_relation_types (adapter , relation_to_type ):
9799 # Ensure that models with different materialiations have the
98100 # corrent table/view.
@@ -128,7 +130,7 @@ def check_relation_types(adapter, relation_to_type):
128130
129131
130132# Overwrite the default implementation to use this adapter's
131- # relation_from_name function.
133+ # relation_from_name function.
132134def check_relations_equal (adapter , relation_names : List , compare_snapshot_cols = False ):
133135 # Replaces assertTablesEqual. assertManyTablesEqual can be replaced
134136 # by doing a separate call for each set of tables/relations.
0 commit comments