Plotly generates many warnings because of trying to set `structure(NULL)`
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 2.7k
- Forks
- 641
- PR merge metrics
- No merged PRs in 30d
Description
This line in plotly:
https://github.com/ropensci/plotly/blob/a76100d7c06774ec50c07982ff6bfdb6d2d09e2d/R/plotly_build.R#L281-L284
can result in setting structure(NULL), which throws many warnings.
I have an app with many plots, and one plot generates dozens of copies of this warning:
Warning in structure(if (i %in% npscales()) uniq(d[[i]]) else d[[i]], class = oldClass(x[[i]])) : Calling 'structure(NULL, *)' is deprecated, as NULL cannot have attributes. Consider 'structure(list(), *)' instead.
I don't have a minimal reprex because I haven't spent too much time finding out what kind of data can cause a NULL there, but it's definitely a NULL in d[[i]] that causes these warnings.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in R/plotly_build.R at lines 281-284 and trace how a NULL value in d[[i]] reaches structure(). Reproduce the warning with a plot containing the relevant data shape, then verify that plotly no longer emits the repeated deprecation warnings while preserving the existing plot-building behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100