From 9bf0a2a6eae0ae61bb7ee298d06897af48b4919f Mon Sep 17 00:00:00 2001 From: Taksh Date: Mon, 20 Apr 2026 16:20:16 +0530 Subject: [PATCH] Allow --destination_dialect=bigquery in convert_file The convert_folder subcommand accepts --destination_dialect {bigquery,postgres,duckdb} but convert_file's matching argument is restricted to --destination_dialect {postgres,duckdb}, so `mimic_utils convert_file --destination_dialect bigquery ...` fails at argparse time even though the underlying transpile_file / transpile_query pipeline supports bigquery as a destination (it is in _FUNCTION_MAPPING in transpile.py, alongside postgres and duckdb). The two subcommands should have the same set of destination dialects since they call the same transpilation code. Add "bigquery" to the file parser's choices to mirror the folder parser. --- src/mimic_utils/__main__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mimic_utils/__main__.py b/src/mimic_utils/__main__.py index ba33954e..2b3f862f 100644 --- a/src/mimic_utils/__main__.py +++ b/src/mimic_utils/__main__.py @@ -10,7 +10,7 @@ def main(): file_parser.add_argument("source_file", help="Source file.") file_parser.add_argument("destination_file", help="Destination file.") file_parser.add_argument("--source_dialect", choices=["bigquery", "postgres", "duckdb"], default='bigquery', help="SQL dialect to transpile.") - file_parser.add_argument("--destination_dialect", choices=["postgres", "duckdb"], default='postgres', help="SQL dialect to transpile.") + file_parser.add_argument("--destination_dialect", choices=["bigquery", "postgres", "duckdb"], default='postgres', help="SQL dialect to transpile.") file_parser.set_defaults(func=transpile_file) folder_parser = subparsers.add_parser('convert_folder', help='Transpile all SQL files in a folder.')