@@ -22,13 +22,23 @@ def cli():
2222@click .option ("--validate" , is_flag = True , help = "Validate against Feldera instance" )
2323@click .option ("--json-output" , is_flag = True , help = "Output as JSON" )
2424@click .option ("--no-docs" , is_flag = True , help = "Disable Feldera doc inclusion in prompt" )
25- @click .option ("--verbose" , is_flag = True , help = "Log SQL submitted to validator at each attempt" )
25+ @click .option (
26+ "--verbose" , is_flag = True , help = "Log SQL submitted to validator at each attempt"
27+ )
2628def translate (
27- schema_file : str , query_file : str , validate : bool , json_output : bool , no_docs : bool , verbose : bool
29+ schema_file : str ,
30+ query_file : str ,
31+ validate : bool ,
32+ json_output : bool ,
33+ no_docs : bool ,
34+ verbose : bool ,
2835):
2936 """Translate a single Spark SQL schema + query pair to Feldera SQL."""
3037 if not validate :
31- click .echo ("Warning: running without validation — output SQL is not verified against the Feldera compiler." , err = True )
38+ click .echo (
39+ "Warning: running without validation — output SQL is not verified against the Feldera compiler." ,
40+ err = True ,
41+ )
3242 config = Config .from_env ()
3343 schema_sql = Path (schema_file ).read_text ()
3444 query_sql = Path (query_file ).read_text ()
@@ -53,11 +63,18 @@ def translate(
5363@click .option ("--validate" , is_flag = True , help = "Validate against Feldera instance" )
5464@click .option ("--json-output" , is_flag = True , help = "Output as JSON" )
5565@click .option ("--no-docs" , is_flag = True , help = "Disable Feldera doc inclusion in prompt" )
56- @click .option ("--verbose" , is_flag = True , help = "Log SQL submitted to validator at each attempt" )
57- def translate_file (sql_file : str , validate : bool , json_output : bool , no_docs : bool , verbose : bool ):
66+ @click .option (
67+ "--verbose" , is_flag = True , help = "Log SQL submitted to validator at each attempt"
68+ )
69+ def translate_file (
70+ sql_file : str , validate : bool , json_output : bool , no_docs : bool , verbose : bool
71+ ):
5872 """Translate a single combined Spark SQL file (schema + views) to Feldera SQL."""
5973 if not validate :
60- click .echo ("Warning: running without validation — output SQL is not verified against the Feldera compiler." , err = True )
74+ click .echo (
75+ "Warning: running without validation — output SQL is not verified against the Feldera compiler." ,
76+ err = True ,
77+ )
6178 config = Config .from_env ()
6279 combined_sql = Path (sql_file ).read_text ()
6380 schema_sql , query_sql = split_combined_sql (combined_sql )
@@ -148,8 +165,12 @@ def batch(data_dir: str, validate: bool, output_dir: str | None, no_docs: bool):
148165)
149166@click .option ("--json-output" , is_flag = True , help = "Output as JSON" )
150167@click .option ("--no-docs" , is_flag = True , help = "Disable Feldera doc inclusion in prompt" )
151- @click .option ("--verbose" , is_flag = True , help = "Log SQL submitted to validator at each attempt" )
152- def example (name : str | None , validate : bool , json_output : bool , no_docs : bool , verbose : bool ):
168+ @click .option (
169+ "--verbose" , is_flag = True , help = "Log SQL submitted to validator at each attempt"
170+ )
171+ def example (
172+ name : str | None , validate : bool , json_output : bool , no_docs : bool , verbose : bool
173+ ):
153174 """Run a built-in example translation.
154175
155176 Without NAME, lists available examples. With NAME, translates that example.
@@ -199,7 +220,10 @@ def example(name: str | None, validate: bool, json_output: bool, no_docs: bool,
199220 click .echo ("\n Translating...\n " , err = True )
200221
201222 if not validate :
202- click .echo ("Warning: running without validation — output SQL is not verified against the Feldera compiler." , err = True )
223+ click .echo (
224+ "Warning: running without validation — output SQL is not verified against the Feldera compiler." ,
225+ err = True ,
226+ )
203227 config = Config .from_env ()
204228 result = translate_spark_to_feldera (
205229 schema_sql ,
0 commit comments