Copy the database file to sandbox.
(task_name, variant)
| 144 | |
| 145 | |
| 146 | def copy_database_file(task_name, variant): |
| 147 | """Copy the database file to sandbox.""" |
| 148 | db_name = variant["db_name"] |
| 149 | db_type = variant["db_type"] |
| 150 | |
| 151 | # Determine the database directory based on db_type |
| 152 | if db_type == "duckdb": |
| 153 | db_dir = Path("shared/databases/duckdb") |
| 154 | db_file = db_dir / f"{db_name}.duckdb" |
| 155 | else: |
| 156 | print(f"✓ No need to copy database file for {db_type}") |
| 157 | return True |
| 158 | |
| 159 | sandbox_dir = Path("dev/sandbox") |
| 160 | return copy_item(db_file, sandbox_dir, f"database '{db_file.name}'") |
| 161 | |
| 162 | |
| 163 | def copy_task_files(task_name): |