Skip to content

cull_database_entries: filter rows (not columns) by machine_id - #4284

Draft
madhavzanwar wants to merge 1 commit into
PecanProject:developfrom
madhavzanwar:GH-4281-cull-database-entries-machine-id
Draft

madhavzanwar wants to merge 1 commit into
PecanProject:developfrom
madhavzanwar:GH-4281-cull-database-entries-machine-id

Conversation

@madhavzanwar

Copy link
Copy Markdown
Contributor

Description

table[table$machine_id == machine_id] had no comma, so the logical vector indexed columns instead of rows: the filter that is meant to prevent deleting rows from other databases did nothing, and rows belonging to other machines were deleted as well. The fix is the missing comma.

Adds a test with two machines that checks only the matching row is deleted; it fails on develop and passes with the fix.

Out of scope here: a NA in machine_id would give an NA row and a harmless where id = NA query; that can only come from a hand-edited input file.

Motivation and Context

Fixes #4281

Review Time Estimate

  • Immediately
  • Within one week
  • When possible

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation.
  • My name is in the list of CITATION.cff
  • I agree that PEcAn Project may distribute my contribution under any or all of
    • the same license as the existing code,
    • and/or the BSD 3-clause license.
  • I have updated the CHANGELOG.md.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@madhavzanwar

Copy link
Copy Markdown
Contributor Author

Thank you for the review and approval, @infotroph!

Whenever one of the 3 active non-draft PRs is merged, I will mark this ready for review (or feel free to merge directly whenever convenient).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cull_database_entries() machine_id filter is a no-op due to missing comma in row indexing

2 participants