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

Connection returns an empty data table when some fields are NULL (since data.table 1.15.0) #164

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gregleleu
Copy link

data.table no longer fills in rows with NA when some of the values are NULL since 1.15.0.
This broke connection:

  • empty tables are returned
  • Leads to flexpolyline::decode_sf being called on a NULL
  • returning "Invalid format version"

This pull fixes that by recreating the rlang operator %||% and using it to avoid nulls.
Maybe not exactly your philosophy, and maybe needs to be replicated in other places, but a first step towards resolution :)

- Fix NULL not handled by data.table anymore
@munterfi
Copy link
Owner

Hi @gregleleu, thanks for reporting.

Can you post a reproducible example, where this error occurs?

In the tests everything seems to work fine with data.table version 1.15.2.

Thanks!

@munterfi munterfi self-assigned this Mar 16, 2024
@gregleleu
Copy link
Author

Sure:

from <- st_as_sfc("POINT (-0.074385 51.41419)", crs = 4326) %>% st_as_sf()
to   <- st_as_sfc("POINT (-0.072941 51.4144)", crs = 4326) %>% st_as_sf()

hereR::connection(
          origin = from,
          destination = to,
          datetime = as.POSIXct("2024-03-13 08:00:00 UTC"),
          results = 1,
          summary = FALSE)

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 this pull request may close these issues.

None yet

2 participants