Skip to content

Gdr 3282#180

Merged
darsoo merged 4 commits intomainfrom
GDR-3282
Feb 16, 2026
Merged

Gdr 3282#180
darsoo merged 4 commits intomainfrom
GDR-3282

Conversation

@darsoo
Copy link
Contributor

@darsoo darsoo commented Feb 12, 2026

Description

What changed?

Expanded the functionality of the remove_drug_batch function to support various input types. Previously, the function strictly required a character vector. It now accepts any atomic vector (e.g., integer, numeric) while ensuring the output remains consistent by performing an explicit conversion to the character class.

Related JIRA issue: GDR-3282

Checklist for sustainable code base

  • I added tests for any code changed/added
  • I added documentation for any code changed/added
  • I made sure naming of any new functions is self-explanatory and consistent

Logistic checklist

  • Package version bumped
  • Changelog updated

@darsoo darsoo requested a review from a team as a code owner February 12, 2026 11:41
@darsoo darsoo requested review from bczech and gladkia and removed request for a team February 12, 2026 11:41
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @darsoo, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly improves the flexibility of the remove_drug_batch function within the gDRutils package. By allowing a broader range of atomic vector types as input, the function becomes more robust and easier to integrate into various data processing workflows. The change ensures that while input types are more permissive, the function's output remains consistent through internal type coercion, thereby maintaining data integrity and predictability.

Highlights

  • Enhanced remove_drug_batch function: The remove_drug_batch function now accepts any atomic vector (e.g., integer, numeric) as input for drug_vec, expanding its usability beyond just character vectors.
  • Consistent Output: An explicit conversion to character is performed within remove_drug_batch to ensure consistent output regardless of the input atomic vector type.
  • Updated Documentation and Tests: The function's documentation and test suite have been updated to reflect and validate the new input flexibility.
  • Package Version Bump: The package version has been incremented to 1.9.5, and the changelog has been updated accordingly.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • NEWS.md
    • gDRutils 1.9.5 - 2026-02-12
    • remove_drug_batch supports atomic vectors as input
Activity
  • No human activity (comments, reviews) has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request expands the remove_drug_batch function to accept any atomic vector, not just character vectors. The changes are well-implemented, with corresponding updates to documentation and the addition of relevant test cases. I've identified one minor opportunity for improvement to make the code more concise by removing a redundant type conversion. Overall, this is a good enhancement to the function's usability.

Comment on lines +1039 to +1040
drug_vec <- as.character(drug_vec)

Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The sub() function automatically coerces its x argument to a character vector if it's not one already. Therefore, this explicit conversion with as.character() is redundant. You can remove this line and the following empty line for conciseness.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am aware that sub() performs implicit coercion, but I added the explicit as.character() call intentionally to improve workflow transparency. It makes the type conversion explicit for anyone reading the code, ensuring that the expected data format is clear before it hits the regex logic.

@darsoo darsoo merged commit e495158 into main Feb 16, 2026
3 of 4 checks passed
@darsoo darsoo deleted the GDR-3282 branch February 16, 2026 08:59
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.

3 participants