(columns: &AlignedOhlcvColumns)
| 519 | i = j; |
| 520 | } |
| 521 | |
| 522 | let calendar = df!("symbol" => cal_symbols, "ts_us" => cal_ts) |
| 523 | .map_err(|e| DataProcessingError::frame("calendar df build failed", e))?; |
| 524 | |
| 525 | // Polars does not keep the left order of a join unless asked; the calendar is already |
| 526 | // sorted by `(symbol, ts_us)`, which is the documented output order. |
| 527 | let mut join_args = JoinArgs::new(JoinType::Left); |
| 528 | join_args.maintain_order = MaintainOrderJoin::Left; |
| 529 | let mut out = calendar |
| 530 | .join(&cleaned, ["symbol", "ts_us"], ["symbol", "ts_us"], join_args, None) |
| 531 | .map_err(|e| DataProcessingError::frame("calendar join failed", e))?; |
| 532 | |
| 533 | let mut missing = out |
| 534 | .column("open") |
| 535 | .map_err(|e| DataProcessingError::frame("column lookup", e))? |
| 536 | .is_null() |
| 537 | .into_column(); |
| 538 | missing.rename("is_missing_bar".into()); |
| 539 | out.with_column(missing) |
| 540 | .map_err(|e| DataProcessingError::frame("failed to add is_missing_bar", e))?; |
| 541 | |
| 542 | Ok((out, report)) |
| 543 | } |
no test coverage detected