MCPcopy Create free account
hub / github.com/PRQL/prql / compile_project

Function compile_project

prqlc/prqlc/src/cli/test.rs:270–357  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

268
269#[test]
270fn compile_project() {
271 let mut cmd = prqlc_command();
272 cmd.args([
273 "compile",
274 "--hide-signature-comment",
275 "--debug-log=log_test.json",
276 project_path().to_str().unwrap(),
277 "-",
278 "main",
279 ]);
280
281 assert_cmd_snapshot!(cmd, @"
282 success: true
283 exit_code: 0
284 ----- stdout -----
285 WITH table_1 AS (
286 SELECT
287 120 AS artist_id,
288 DATE '2023-05-18' AS last_listen
289 UNION
290 ALL
291 SELECT
292 7 AS artist_id,
293 DATE '2023-05-16' AS last_listen
294 ),
295 favorite_artists AS (
296 SELECT
297 artist_id,
298 last_listen
299 FROM
300 table_1
301 ),
302 table_0 AS (
303 SELECT
304 *
305 FROM
306 read_parquet('artists.parquet')
307 ),
308 input AS (
309 SELECT
310 *
311 FROM
312 table_0
313 )
314 SELECT
315 favorite_artists.artist_id,
316 favorite_artists.last_listen,
317 input.*
318 FROM
319 favorite_artists
320 LEFT OUTER JOIN input ON favorite_artists.artist_id = input.artist_id
321
322 ----- stderr -----
323 ");
324
325 // don't check the contents, they are very prone to change
326 assert!(PathBuf::from_str("./log_test.json").unwrap().is_file());
327

Callers

nothing calls this directly

Calls 2

project_pathFunction · 0.85
prqlc_commandFunction · 0.70

Tested by

no test coverage detected