Comments (22)
More minimal:
con <- sparklyr::spark_connect(master = "local")
lobstr::obj_size(con$state)
Error probably comes from https://github.com/wch/r-source/blob/79298c499218846d14500255efd622b5021c10ec/src/include/Rinlinedfuns.h#L89
from lobstr.
Looks like this is an "immediate binding": https://github.com/wch/r-source/blob/79298c499218846d14500255efd622b5021c10ec/doc/notes/immbnd.md#L25
from lobstr.
@eliotmcintire can you please file a new issue?
from lobstr.
I can also reproduce this error with the legacy pryr::object_size()
, whereas utils::object.size()
works as expected.
from lobstr.
Can you provide a reprex?
from lobstr.
I receive this error when attempting to calculate the size of tibble that is a link to Spark data table. Error shows up in both pryr and lobstr with slightly different semantics.
pryr: "<simpleError in object_sizes(list(...), env): bad binding access>"
lobstr: "<simpleError in obj_size_(dots, env, size_node(), size_vector()): bad binding access>"
The pryr information is not meant to be distracting/off topic, but rather hopefully add additional information that is helpful.
Also, I used the tidyft package to calculate object size and that worked.
LMK if you need a reprex or more info.
Thanks.
from lobstr.
A reprex would be very useful because I'll need to figure out what's going wrong in the C code.
from lobstr.
Above is the link to the notebook and the RMD file.
👍
Just let me know if you need anything else.
from lobstr.
Could you please made a small reprex and include it inline?
from lobstr.
Sure, here is just the code for the lobstr package. I hope this is minimal enough.
#Convert the time series data to a tibble
EU_stock_tibl <- ts_tbl(EuStockMarkets)
#Spark Connection
spark_connection <- spark_connect(master = "local")
#Copy data to Spark
EU_stock_spark_link <- copy_to(spark_connection, EU_stock_tibl, "EU_stock_spark", overwrite = TRUE)
#Size
tryCatch({
lobstr::obj_size(EU_stock_spark_link)
},
error = print
)
from lobstr.
Just following up on this to see where things are at and if my code sample worked out as needed. I see it still has the reprex label. Datacamp uses the pypr package, but not the lobstr package in their course. I mentioned this issue to them so I am just following up as the ticket is still in my inbox.
from lobstr.
Could you please rework your reproducible example to use the reprex package ? That makes it easier to see both the input and the output, formatted in such a way that I can easily re-run in a local session.
from lobstr.
Yep, below is the example created with the reprex package. Thanks for letting me know this is what you were looking for.
library(pryr)
#> Registered S3 method overwritten by 'pryr':
#> method from
#> print.bytes Rcpp
library(lobstr)
#>
#> Attaching package: 'lobstr'
#> The following objects are masked from 'package:pryr':
#>
#> ast, mem_used
library(tidyft)
#>
#> Life's short, use R.
#>
#> Attaching package: 'tidyft'
#> The following object is masked from 'package:pryr':
#>
#> object_size
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
library(dplyr)
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:tidyft':
#>
#> add_count, anti_join, arrange, count, cummean, distinct, filter,
#> full_join, group_by, groups, inner_join, lag, lead, left_join,
#> mutate, nth, pull, relocate, rename, right_join, select,
#> select_vars, semi_join, slice, slice_head, slice_max, slice_min,
#> slice_sample, slice_tail, summarise, transmute, ungroup
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
library(tsbox)
library(sparklyr)
#>
#> Attaching package: 'sparklyr'
#> The following objects are masked from 'package:tidyft':
#>
#> distinct, fill, full_join, inner_join, left_join, nest, right_join,
#> separate, unite, unnest
library(datasets)
EU_stock_tibl <- ts_tbl(EuStockMarkets)
spark_connection <- spark_connect(master = "local")
EU_stock_spark_link <- copy_to(spark_connection, EU_stock_tibl, "EU_stock_spark", overwrite = TRUE)
tryCatch({
tidyft::object_size(EU_stock_spark_link)
},
error = print
)
#> 10.1 Kb
tryCatch({
pryr::object_size(EU_stock_spark_link)
},
error = print
)
#> <simpleError in object_sizes(list(...), env): bad binding access>
tryCatch({
lobstr::obj_size(EU_stock_spark_link)
},
error = print
)
#> <simpleError in obj_size_(dots, env, size_node(), size_vector()): bad binding access>
Created on 2021-01-07 by the reprex package (v0.3.0)
from lobstr.
Could you please try to make your reprex a little more minimal by only showing the problem with lobstr, and removing anything that isn't directly related? (e.g. the tryCatch()
calls).
from lobstr.
from lobstr.
Okay, the new reprex is posted below. Thank you.
library(lobstr)
library(dplyr)
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
library(tsbox)
library(sparklyr)
library(datasets)
EU_stock_tibl <- ts_tbl(EuStockMarkets)
spark_connection <- spark_connect(master = "local")
EU_stock_spark_link <- copy_to(spark_connection, EU_stock_tibl, "EU_stock_spark", overwrite = TRUE)
lobstr::obj_size(EU_stock_spark_link)
#> Error in obj_size_(dots, env, size_node(), size_vector()): bad binding access
Created on 2021-01-07 by the reprex package (v0.3.0)
from lobstr.
More minimal reprex:
con <- sparklyr::spark_connect(master = "local")
spark_mtcars <- dplyr::copy_to(con, mtcars, "mtcars", overwrite = TRUE)
lobstr::obj_size(spark_mtcars)
#> Error in obj_size_(dots, env, size_node(), size_vector()): bad binding access
Created on 2022-06-21 by the reprex package (v2.0.1)
from lobstr.
I have a fix that works locally, but making it work properly will be quite a lot of extra effort so unfortunately probably won't make it for this release.
from lobstr.
Cool thanks @hadley !
from lobstr.
Are there updates on this?
I am seeing the same error (bad binding access) now with my reproducible
package on CRAN with devel versions of R.
I can manually reproduce this with R-devel on my local machines.
The minimal reprex using R-devel
is:
lobstr::obj_size(as.environment("package:lobstr"))
This worked with all previous versions of R.
from lobstr.
I'm seeing this same problem in butcher on R-devel, because of the use of lobstr here. It's not for all models, just for nnet, FWIW.
from lobstr.
I just used rig to install R-devel and I cannot reproduce the problem locally. 😔
from lobstr.
Related Issues (20)
- Release lobstr 1.1.1
- Use the ALTREP inspect method in sxp
- modify ast tree HOT 1
- obj_sizes gives NA for objects larger than 2^31 bytes
- List R-core as contributor in DESCRIPTION HOT 1
- Request: make `ast()` not automatically unwrap quosures HOT 3
- List all parent environments for a given environment HOT 1
- obj_size() formatting for large objects
- Move `master` branch to `main` HOT 1
- `obj_size` returns different values before and after accessing an element HOT 4
- `format()` method for `lobstr_bytes` HOT 1
- Use consistent type abbreviations
- Release lobstr 1.1.2
- Switch to rlang bytes formatting to eliminate prettyunits dep
- Error for incorrect sxp expand argument does not print list of acceptable values
- Is the output of `ast` wrong for functions with a namespace? HOT 1
- Upkeep for lobstr (2022)
- Reference count seems to be off
- `Error in obj_size_(dots, env, size_node(), size_vector()) : bad binding access` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lobstr.