dkahle / dkahle/ggmap

showing_key() returns `NULL` unless ggmap is attached

Open
#264 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
R
Stars
778
Forks
234
PR merge metrics
No merged PRs in 30d

Description

I just encountered this helping someone troubleshoot something in their package.

`showing_key()` is used internally as if it will always return logical. But it can return `NULL` if the option `ggmap.show_api_key` is unset. This option is only set in `.onAttach()`, therefore it returns `NULL` when people use ggmap without attaching it.

``` r
ggmap::showing_key()
#> NULL
```

Created on 2019-02-06 by the [reprex package](https://reprex.tidyverse.org) (v0.2.1)

This then creates various problems downstream, since `showing_key()` is used internally in many functions.

Probably related to #244 Registering API key only works when package is loaded *but I think that should read "attached" instead of "loaded"*

Contributor guide

No contributing guide indexed for this repository

Research direction

Search for showing_key() and .onAttach(), then trace how the ggmap.show_api_key option is read when ggmap is used without being attached. Confirm that showing_key() returns a logical value rather than NULL in that case, and check the internal callers for downstream regressions.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.