dfe-analytical-services / dfe-analytical-services/eesyapi.R
Error when querying data sets without filters
- Dominant language
- R
- Stars
- 3
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Description
## Describe the bug
When `eesyapi::get_meta()` or `eesyapi::query_dataset()` is ran on an API dataset which contains no filters (excluding standard time and geography filters) and error is thrown.
## How to reproduce
Steps to reproduce the behaviour:
1. Retrieve API data set ID from [Schools and colleges - institution information](https://explore-education-statistics.service.gov.uk/data-catalogue/data-set/4e6da9be-0c0f-46a5-b9f8-fc09c6cad8fb), which has no filters.
2. Run either `eesyapi::get_meta("019c2960-34d9-71c0-976c-3540602f2669")` or `eesyapi::query_dataset("019c2960-34d9-71c0-976c-3540602f2669")` on the API data set ID.
4. See error, with message that reads: **Error in fix.by(by.x, x) : 'by' must specify a uniquely valid column**
## Expected behaviour
For `eesyapi::get_meta()` I would expect the usual tables to be retrieved, either without the `$filter_columns` and `$filter_items` tables, or with he `$filter_columns` and `$filter_items` tables left blank.
For `eesyapi::query_dataset()` I would expect this to run, not needing to specify filter items, when there exists no filter columns.
## Screenshots
For `eesyapi::get_meta()`, the outcome is currently,
For `eesyapi::query_dataset()`, the outcome is currently,
Where the warning is expected.
Contributor guide
Assessment
This issue has not been assessed yet.