Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 5, 2026

Python wrangles (functions called directly in Python code) had minimal test coverage. Format module had only 5 tests, while select and compare modules had none.

Changes

Added 51 tests across three modules:

Format module (21 tests)

  • concatenate - list joining with separator control
  • coalesce - first non-empty value selection
  • remove_duplicates - case-sensitive/insensitive deduplication
  • tokenize - boundary and custom function splitting
  • flatten_lists - recursive list flattening

Select module (18 tests)

  • highest_confidence - max confidence selection
  • confidence_threshold - threshold-based fallback
  • list_element - indexing and slicing
  • dict_element - key extraction and renaming

Compare module (12 tests)

  • contrast - string intersection/difference
  • overlap - fuzzy string matching with ratios

Example

# Format: concatenate with empty value handling
wrangles.format.concatenate([['a', '', 'b']], '-', skip_empty=True)
# Returns: ['a-b']

# Select: dictionary key extraction with defaults
wrangles.select.dict_element([{'name': 'Alice'}], 'age', default='Unknown')
# Returns: ['Unknown']

# Compare: find non-matching characters
wrangles.compare.overlap([['hello', 'hallo']], non_match_char='*')
# Returns: ['h*llo']

Test count: 55 → 106 (93% increase)

Original prompt

This section details on the original issue you should resolve

<issue_title>More tests for python wrangles</issue_title>
<issue_description>It seems that we do not have many tests for python wrangles (wrangles that are meant to be uses in python, not python recipe wrangles). Specifically, format only has one, but I am sure that there are many others that are not being tested properly. </issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits January 5, 2026 16:47
…re modules)

Co-authored-by: ebhills <53243273+ebhills@users.noreply.github.com>
Co-authored-by: ebhills <53243273+ebhills@users.noreply.github.com>
Co-authored-by: ebhills <53243273+ebhills@users.noreply.github.com>
Copilot AI changed the title [WIP] Add more tests for python wrangles Add comprehensive test coverage for Python wrangles (format, select, compare) Jan 5, 2026
Copilot AI requested a review from ebhills January 5, 2026 16:52
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.

More tests for python wrangles

2 participants