Skip to content

Add deployment_id argument to get_acoustic_detections()#506

Open
PietrH wants to merge 11 commits intomainfrom
504-missing-arg
Open

Add deployment_id argument to get_acoustic_detections()#506
PietrH wants to merge 11 commits intomainfrom
504-missing-arg

Conversation

@PietrH
Copy link
Copy Markdown
Member

@PietrH PietrH commented Mar 24, 2026

This argument was intended to be added in v3.0.0, but somehow omitted. All structural work was already done so this is a minor change.

I do need to make sure test coverage is sufficient. Because I'm adding an argument, and the client sends the default value (including NULL) for all arguments to the service, all detections cassettes (cached HTTP interactions) will need to be recreated. Otherwise the tests will fail due to a vcr mismatch.

@PietrH PietrH linked an issue Mar 24, 2026 that may be closed by this pull request
4 tasks
@PietrH PietrH self-assigned this Mar 24, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.76%. Comparing base (b673a44) to head (be581d7).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #506   +/-   ##
=======================================
  Coverage   86.76%   86.76%           
=======================================
  Files          26       26           
  Lines         748      748           
=======================================
  Hits          649      649           
  Misses         99       99           

☔ 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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR restores the missing deployment_id filter in get_acoustic_detections() (intended for v3.0.0), updates documentation, and refreshes VCR fixtures so the test suite matches the updated request payloads.

Changes:

  • Add deployment_id argument to get_acoustic_detections() and document it.
  • Add a new test verifying filtering by deployment_id.
  • Re-record/update VCR cassettes (fixtures) to include deployment_id in request bodies.

Reviewed changes

Copilot reviewed 23 out of 26 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
R/get_acoustic_detections.R Adds deployment_id to the exported function signature (and roxygen param inheritance).
man/get_acoustic_detections.Rd Documents the new deployment_id argument in the public manual page.
tests/testthat/test-get_acoustic_detections.R Adds a new test covering deployment_id filtering.
tests/fixtures/*.yml Updates recorded HTTP interactions so request bodies include deployment_id (including null).
NEWS.md Notes the bugfix for the missing deployment_id argument.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/testthat/test-get_acoustic_detections.R
@PietrH
Copy link
Copy Markdown
Member Author

PietrH commented Mar 24, 2026

The server can not handle very large requests:

get_acoustic_detections(acoustic_project_code = "albert")
✔ Preparing : will fetch 25.95 M detections [50.2s]
Error in `req_perform_opencpu()`:
! cannot allocate vector of size 45.6 MbThis is an error forwarded via the API.
Run `rlang::last_trace()` to see where the error occurred.

This might be a config error in {etnservice}, I really should try to avoid allocating such large vectors. I was under the impression this was avoided by the internal paging of etnservice::get_acoustic_detections_page().

Probably need to make an issue in etnservice.

@PietrH
Copy link
Copy Markdown
Member Author

PietrH commented Mar 24, 2026

The server can not handle very large requests:

get_acoustic_detections(acoustic_project_code = "albert")
✔ Preparing : will fetch 25.95 M detections [50.2s]
Error in `req_perform_opencpu()`:
! cannot allocate vector of size 45.6 MbThis is an error forwarded via the API.
Run `rlang::last_trace()` to see where the error occurred.

This might be a config error in {etnservice}, I really should try to avoid allocating such large vectors. I was under the impression this was avoided by the internal paging of etnservice::get_acoustic_detections_page().

Probably need to make an issue in etnservice.

Issue #507

@PietrH PietrH marked this pull request as ready for review March 24, 2026 12:28
@PietrH PietrH requested a review from peterdesmet March 24, 2026 12:29
@PietrH
Copy link
Copy Markdown
Member Author

PietrH commented Mar 26, 2026

@peterdesmet, have you had a chance to look at this? If not, I can reassign to Lotte to review.

@peterdesmet
Copy link
Copy Markdown
Member

I have not, please feel welcome to reassign.

@PietrH PietrH removed the request for review from peterdesmet March 26, 2026 09:36
@PietrH
Copy link
Copy Markdown
Member Author

PietrH commented Mar 26, 2026

@lottepohl, would you be willing/able to test this out? I don't know if you've ever done a review on Github before. If you want we can go over it in a call real quick, but I basically I need someone other than me to test if my changes actually work :)

If you don't have time, I can find someone else!

@lottepohl
Copy link
Copy Markdown
Collaborator

Hi @PietrH, would love to! You're right, I have not done a review before so I'd appreciate a quick call.
I'll drop you a message ;)
Cheers!
Lotte

@PietrH PietrH requested a review from lottepohl April 2, 2026 07:39
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.

Add missing deployment_id in get_acoustic_detections()

4 participants