MCPcopy Create free account
hub / github.com/dbt-labs/ade-bench / find_matching_variant

Function find_matching_variant

scripts_python/create_sandbox.py:122–143  ·  view source on GitHub ↗

Find the matching variant for the given db_type and project_type.

(task_name, db_type, project_type)

Source from the content-addressed store, hash-verified

120
121
122def find_matching_variant(task_name, db_type, project_type):
123 """Find the matching variant for the given db_type and project_type."""
124 task_data = get_task_config(task_name)
125 if not task_data:
126 return None
127
128 # Check if variants exist
129 if "variants" not in task_data:
130 print(f"Error: No variants found in task '{task_name}'")
131 return None
132
133 variants = task_data["variants"]
134
135 # Find matching variant
136 for variant in variants:
137 if variant.get("db_type") == db_type and variant.get("project_type") == project_type:
138 return variant
139
140 print(
141 f"Error: No variant found for db_type='{db_type}' and project_type='{project_type}' in task '{task_name}'"
142 )
143 return None
144
145
146def copy_database_file(task_name, variant):

Callers 1

mainFunction · 0.85

Calls 1

get_task_configFunction · 0.85

Tested by

no test coverage detected