DaveM2430 commited on
Commit
88af693
Β·
verified Β·
1 Parent(s): d7fc450

Update app.R

Browse files
Files changed (1) hide show
  1. app.R +7 -3
app.R CHANGED
@@ -17,15 +17,19 @@ load_scores <- function(level) {
17
  }
18
 
19
  load_portal <- function() {
20
- tryCatch(
21
- arrow::read_parquet("/app/transfer_portal.parquet"),
 
 
 
 
 
22
  error = function(e) {
23
  message("Portal load failed: ", e$message)
24
  tibble(Pitcher=character(), Portal=character())
25
  }
26
  )
27
  }
28
-
29
  # ── Pitch colors ───────────────────────────────────────────────────────────────
30
  pitch_colors <- c(
31
  "Fastball" = "red", "Sinker" = "orange",
 
17
  }
18
 
19
  load_portal <- function() {
20
+ tryCatch({
21
+ df <- arrow::read_parquet("/app/transfer_portal.parquet")
22
+ names(df) <- tolower(names(df))
23
+ df %>%
24
+ rename(Pitcher = pitcher, Portal = portal) %>%
25
+ distinct(Pitcher, .keep_all = TRUE)
26
+ },
27
  error = function(e) {
28
  message("Portal load failed: ", e$message)
29
  tibble(Pitcher=character(), Portal=character())
30
  }
31
  )
32
  }
 
33
  # ── Pitch colors ───────────────────────────────────────────────────────────────
34
  pitch_colors <- c(
35
  "Fastball" = "red", "Sinker" = "orange",