mitre / mitre/GraphEx

Strip String node doesn't properly handle strings of characters

Open
#14 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug good first issue
Dominant language
Python
Stars
2
Forks
1
PR merge metrics
No merged PRs in 30d

Description

The strip string node should follow the python3 strip functionality. Currently, it strips whitespace if nothing is provided to the 'Characters' input. If a character is provided to the 'Characters' input, then it properly strips that character from the front and back of the provided String.

The bug is that the node only uses the first character in the 'Characters' input for the strip operation even if a full string is provided. It should instead either follow the 'strip all matching characters' behavior of the python3 libs or should remove matching substrings from the front/back of the string.

Image Image

The python description of split:
https://docs.python.org/3/library/stdtypes.html#str.strip

The relevant node in GraphEx:
https://github.com/mitre/GraphEx/blob/main/graphex/nodes/strings.py#L93

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the strip string node at graphex/nodes/strings.py around line 93, then compare its behavior with Python's str.strip documentation. Reproduce the case where the Characters input contains multiple characters and confirm the expected matching behavior before changing it; done means the node handles the full input consistently with the chosen behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.