Skip to content

Commit

Permalink
Make arrow optional (#166)
Browse files Browse the repository at this point in the history
* Make arrow optional

* fixed spelling

---------

Co-authored-by: andrewjbe <56839927+andrewjbe@users.noreply.github.com>
  • Loading branch information
brancengregory and andrewjbe authored May 23, 2024
1 parent e1b577f commit 08b9163
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 6 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: ojodb
Title: Analyze Data from the Open Justice Oklahoma Database
Version: 2.8.0
Version: 2.8.1
Authors@R: c(
person(
given = "Brancen",
Expand All @@ -26,7 +26,6 @@ Authors@R: c(
))
Description: {ojodb} provides convenient functions to query court data from the Open Justice Oklahoma database.
Imports:
arrow,
cli,
dbplyr,
DBI,
Expand All @@ -45,6 +44,7 @@ Imports:
utils,
withr
Suggests:
arrow,
attachment,
badger,
covr,
Expand Down
7 changes: 6 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
# ojodb 2.8.1 (2024-05-23)

## Dependency Fix
- Makes `{arrow}` and optional dependency and checks whether it is available when `source = "gcs"` is used in `ojo_tbl`.

# ojodb 2.8.0 (2024-05-20)

## New Features
- Adds initial support for Arrow.

## Package Maintanance
## Package Maintenance
- Uses `{lifecycle}` for function development status.

# ojodb 2.7.0 (2023-09-01)
Expand Down
11 changes: 11 additions & 0 deletions R/ojo_tbl.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,17 @@ ojo_tbl <- function(
}
data <- tbl_from_database(.con, schema, table)
} else if (.source == "gcs") {

# Abort if {arrow} isn't available
if (!rlang::is_installed("arrow")) {
rlang::abort(".source == \"gcs\" requires {arrow} with GCS support.")
}

gcs_available <- arrow::arrow_with_gcs()
if (!gcs_available) {
rlang::abort(stringr::str_glue("Arrow wasn't compiled with GCS support."))
}

# Temp fix for schema
if (schema == "public") {
schema <- "oscn"
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@

# ojodb <img src="man/figures/logo.png" align="right" height="139" />

`{ojodb}` is a package that helps
`{ojodb}` is a package that assists
<a href="https://openjustice.okpolicy.org/" target="_blank">Open Justice
Oklahoma</a> analysts access and analyze court, jail, prison, and
Oklahoma</a> analysts to access and analyze court, jail, prison, and
other data collected from various sources.

The pkgdown website for the ojodb package can be found
<a href="https://openjusticeok.github.io/ojodb/"
target="_blank">here</a>.

## Installation
## Installation

Install the devtools package if you don’t have it yet, then install the
ojodb package from GitHub with:
Expand Down
4 changes: 4 additions & 0 deletions inst/WORDLIST
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,7 @@ tibble
tidyverse
timespan
webscraping
gcs
GCS
PRs
tbl

0 comments on commit 08b9163

Please sign in to comment.