Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

h2o.removeAll() in R is removing all keys (including retained) from list h2o.ls() although frames are still accessible #7749

Closed
exalate-issue-sync bot opened this issue May 11, 2023 · 4 comments
Assignees

Comments

@exalate-issue-sync
Copy link

{noformat}titanic <- h2o.importFile("https://s3.amazonaws.com/h2o-public-test-data/smalldata/gbm_test/titanic.csv")
titanic2 <- h2o.importFile("https://s3.amazonaws.com/h2o-public-test-data/smalldata/gbm_test/titanic.csv")
h2o.ls(){noformat}

{quote}A data.frame: 2 × 1
key

titanic.hex_sid_82b9_70
titanic.hex_sid_82b9_71{quote}

{noformat}h2o.removeAll(retained_elements = c(h2o.keyof(titanic)))
h2o.ls(){noformat}

{quote}A data.frame: 0 × 1

key

{quote}

^no keys listed. Sounds like they are all removed and none were retained.

However, {{titanic}} and {{titanic2}} are still accessible.

@exalate-issue-sync
Copy link
Author

Neema Mashayekhi commented: Note that this issue was not found in with Python client

@exalate-issue-sync
Copy link
Author

Erin LeDell commented: [~accountid:5dc4f5bbb6e6b50c58af0624] This does look like a bug (the {{titanic}} H2OFrame should be retained).

However, just in case it’s not clear, using {{h2o.removeAll()}} should only remove the H2OFrames on the backend. The corresponding R objects, {{titanic}} and {{titanic2}} still exist but they only contain metadata and you can’t actually get the H2OFrames back (so that works as expected).

@exalate-issue-sync
Copy link
Author

Michal Kurka commented: Erin’s assessment seems correct to me, the main issue is that the “retained_elements” parameter is not propagated to the backend.

11-12 09:08:41.435 192.168.86.136:54321  87216  7712235-18  INFO water.default: DELETE /3/DKV, parms: {retained_keys=[]}

This happens because you are passing keys instead of objects and this piece of code discards the argument:

for (element in retained_elements) {
if (is(element, "H2OModel")) {
retained_keys <- append(retained_keys, element@model_id)
} else if (is.H2OFrame(element)) {
retained_keys <- append(retained_keys, h2o.getId(element))
}
}

Documentation should be clarified and the code fixed in order to either accept keys as well or fail on incorrect input.

@h2o-ops
Copy link
Collaborator

h2o-ops commented May 14, 2023

JIRA Issue Migration Info

Jira Issue: PUBDEV-7896
Assignee: Adam Valenta
Reporter: Neema Mashayekhi
State: Resolved
Fix Version: 3.32.0.3
Attachments: N/A
Development PRs: Available

Linked PRs from JIRA

#5137

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants