sol-eng / bike_predict

A demo of an end-to-end machine learning pipeline, using Posit Connect
93 stars 31 forks source link

ETL Step 01 - Update the Database is failing #17

Closed SamEdwardes closed 2 years ago

SamEdwardes commented 2 years ago

For some reason the first ETL job is failing on Connect. It is working on Workbench. Here are the logs:

05/06 18:41:10.973 (GMT)
Data access failure: Error in loadNamespace(x): there is no package called 'httr'
05/06 18:41:10.973 (GMT)
Quitting from lines 28-53 (update_db.qmd)
05/06 18:41:10.974 (GMT)
Error in UseMethod("mutate") :
05/06 18:41:10.974 (GMT)
no applicable method for 'mutate' applied to an object of class "NULL"
05/06 18:41:10.974 (GMT)
Calls: local ... withVisible -> eval -> eval -> %>% -> <Anonymous> -> <Anonymous>
05/06 18:41:10.974 (GMT)
In addition: Warning message:
05/06 18:41:10.974 (GMT)
In system("whoami", intern = TRUE) : running command 'whoami' had status 1
05/06 18:41:10.977 (GMT)
Execution halted

The issue looks to be around here:

https://github.com/sol-eng/bike_predict/blob/4be9fac90712b88d1a1d2304d4ec62c5c260694d/content/01-etl/01-update-db/update_db.qmd#L28-L32

For some reason this is returning NULL.

akgold commented 2 years ago

My guess is that there's a call to httr buried in there, but it's not getting into the manifest for some reason. My bet is putting a library(httr) and updating the manifest will fix.

SamEdwardes commented 2 years ago

Thank you Alex - just confirmed the issue was httr. For some reason Connect does not know that bikeHelpR depends on httr. As a work I have to import httr in my quarto document even though I never call it directly.

library(dplyr)
library(odbc)

# The following packages are not directly called, but are requirements. They
# need to be here so that `rsconnect::writeManifest` is able to capture them
# as a dependency.
library(dbplyr)
library(purrr)
library(magrittr)
library(httr)
akgold commented 2 years ago

Looks like someone (me) forgot to add httr to the bikeHelpR imports.