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

Set empty fields to NULL instead of an empty object #21

Closed
lazappi opened this issue Oct 9, 2024 · 1 comment · Fixed by #28
Closed

Set empty fields to NULL instead of an empty object #21

lazappi opened this issue Oct 9, 2024 · 1 comment · Fixed by #28

Comments

@lazappi
Copy link
Collaborator

lazappi commented Oct 9, 2024

Currently, when an object is created any empty fields are filled with an empty object of the expected class. For example:

db <- connect("laminlabs/cellxgene")
artifact <- db$Artifact$get("KBW89Mf7IGcekja2hADu")
run <- artifact$storage$run

Here run is an empty Run object. Instead we should set it to NULL which would be cleaner and match Python.

@lazappi
Copy link
Collaborator Author

lazappi commented Oct 9, 2024

Should have mentioned you get an error if you try to access things in the empty object:

> run$id
Error in `private$.api$get_record()` at laminr/R/Record.R:234:9:
! Method Not Allowed

Possibly there is another solution to this but avoiding the empty objects in the first place has other advantages

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

Successfully merging a pull request may close this issue.

1 participant