Skip to content

Commit 1378393

Browse files
snkasryzhyk
authored andcommitted
python: account for status SqlCompiled in program compilation check
There are demo and benchmark Python scripts which use direct API calls for program compilation. Some of them do not yet account for the new status `SqlCompiled` that was introduced in the compiler rework, and fail as a result. This failure is nondeterministic, as when there is only one program, it would relatively quickly transition to `CompilingRust` and as such there is only a chance of the script observing the new status. This fixes it by adding an extra condition for `SqlCompiled` in the check of whether compilation is still ongoing. Signed-off-by: Simon Kassing <simon.kassing@feldera.com>
1 parent d20e512 commit 1378393

8 files changed

Lines changed: 8 additions & 0 deletions

File tree

benchmark/feldera-sql/run.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,7 @@ def main():
409409
elif (
410410
status != "Pending"
411411
and status != "CompilingRust"
412+
and status != "SqlCompiled"
412413
and status != "CompilingSql"
413414
):
414415
raise RuntimeError(f"Failed program compilation with status {status}")

demo/project_demo01-TimeSeriesEnrich/run.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ def prepare_feldera(api_url, start_pipeline):
105105
elif (
106106
status != "Pending"
107107
and status != "CompilingRust"
108+
and status != "SqlCompiled"
108109
and status != "CompilingSql"
109110
):
110111
raise RuntimeError(f"Failed program compilation with status {status}")

demo/project_demo03-GreenTrip/run.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ def prepare_feldera(api_url, start_pipeline):
8787
elif (
8888
status != "Pending"
8989
and status != "CompilingRust"
90+
and status != "SqlCompiled"
9091
and status != "CompilingSql"
9192
):
9293
raise RuntimeError(f"Failed program compilation with status {status}")

demo/project_demo04-SimpleSelect/run.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ def prepare_feldera(api_url, start_pipeline):
8181
elif (
8282
status != "Pending"
8383
and status != "CompilingRust"
84+
and status != "SqlCompiled"
8485
and status != "CompilingSql"
8586
):
8687
raise RuntimeError(f"Failed program compilation with status {status}")

demo/project_demo06-SupplyChainTutorial/run.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ def main():
168168
elif (
169169
status != "Pending"
170170
and status != "CompilingRust"
171+
and status != "SqlCompiled"
171172
and status != "CompilingSql"
172173
):
173174
raise RuntimeError(f"Failed program compilation with status {status}")

demo/project_demo07-SnowflakeSink/run.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ def prepare_feldera(api_url):
191191
elif (
192192
status != "Pending"
193193
and status != "CompilingRust"
194+
and status != "SqlCompiled"
194195
and status != "CompilingSql"
195196
):
196197
raise RuntimeError(f"Failed program compilation with status {status}")

demo/steady/demo.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ def main():
7676
elif (
7777
status != "Pending"
7878
and status != "CompilingRust"
79+
and status != "SqlCompiled"
7980
and status != "CompilingSql"
8081
):
8182
raise RuntimeError(f"Failed program compilation with status {status}")

scripts/compilation_speed_benchmark.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ def compile(program_name, program, headers):
102102
elif (
103103
status != "Pending"
104104
and status != "CompilingRust"
105+
and status != "SqlCompiled"
105106
and status != "CompilingSql"
106107
):
107108
raise RuntimeError(f"Failed program compilation with status {status}")

0 commit comments

Comments
 (0)