Skip to content

Return more descriptive error for german data query (data too old) - #132

Merged
bart1 merged 12 commits into
mainfrom
131-error-for-selecting-a-old-german-data-is-unclear
Sep 30, 2025
Merged

bart1 merged 12 commits into
mainfrom
131-error-for-selecting-a-old-german-data-is-unclear

Conversation

@bart1

@bart1 bart1 commented Sep 29, 2025

Copy link
Copy Markdown
Collaborator

The old error:

Requested data is too old, only the last 3 days are available

library(getRad)
pvol <- get_pvol("dedrs", as.POSIXct("2012-05-17 14:00", tz = "UTC"))
#> Error in `get_pvol()`:
#> ! The server returned an unexpected number of files

Created on 2025-09-29 with reprex v2.1.1

This is the new error:

devtools::load_all("~/getRad")
#> ℹ Loading getRad
pvol <- get_pvol("dedrs", as.POSIXct("2012-05-17 14:00", tz = "UTC"))
#> Error in `get_pvol()`:
#> ✖ The server returned an unexpected number of files.
#> ℹ In many cases this because no data is available for the time requested. For
#>   Germany only the last three days are available.
#> ℹ Alternatively there is an unstable connection or temporal error in the german
#>   data provided.

Created on 2025-09-29 with reprex v2.1.1

@bart1 bart1 linked an issue Sep 29, 2025 that may be closed by this pull request
@bart1
bart1 requested a review from PietrH September 29, 2025 21:43
capitalization
@codecov

codecov Bot commented Sep 29, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.21%. Comparing base (a82add8) to head (e3b9775).
⚠️ Report is 15 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #132      +/-   ##
==========================================
- Coverage   92.66%   92.21%   -0.46%     
==========================================
  Files          24       24              
  Lines        1472     1733     +261     
==========================================
+ Hits         1364     1598     +234     
- Misses        108      135      +27     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bart1
bart1 requested a review from peterdesmet September 30, 2025 06:41
@PietrH

PietrH commented Sep 30, 2025

Copy link
Copy Markdown
Contributor

Can you keep this in draft until it's ready to review?

@bart1

bart1 commented Sep 30, 2025

Copy link
Copy Markdown
Collaborator Author

Sorry it was ready to review but i merged changes from main to see how the code formatter worked :)

@PietrH PietrH changed the title fix #131 Return more descriptive error for german data query (data too old) Sep 30, 2025

@PietrH PietrH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two small notes, non blocking for merging.

  • I suggest renaming the error class.
  • I suggest making the skip even more strict so we also skip the test if the data provider is offline. But it's worth staying consistent for all tests in the package.

Comment thread R/get_pvol_de.R
Comment thread tests/testthat/test-get_pvol_de.R Outdated
Bart and others added 2 commits September 30, 2025 12:01
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@bart1
bart1 removed the request for review from peterdesmet September 30, 2025 11:05
@bart1 bart1 added this to the CRAN release 0.2.3 or higher milestone Sep 30, 2025
@bart1
bart1 merged commit 4b84a26 into main Sep 30, 2025
16 of 18 checks passed
@bart1
bart1 deleted the 131-error-for-selecting-a-old-german-data-is-unclear branch September 30, 2025 12:11
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.

Error for selecting a old german data is unclear

2 participants