Skip to content

Add 'sort' parameter to keypaths()#467

Merged
fabiocaccamo merged 1 commit intofabiocaccamo:mainfrom
kotfu:main
Jan 18, 2025
Merged

Add 'sort' parameter to keypaths()#467
fabiocaccamo merged 1 commit intofabiocaccamo:mainfrom
kotfu:main

Conversation

@kotfu
Copy link
Contributor

@kotfu kotfu commented Jan 17, 2025


name: Pull request
about: Submit a pull request for this project
assignees: fabiocaccamo


Describe your changes
The keypaths() function sorts the list before returning it. There are use cases where an unsorted list is useful. Added a sort parameter which defaults to True for backwards compatability. Added unit test, and updated README. This PR based on a patch from @mucmch.

Related issue
#404.

Checklist before requesting a review

  • I have performed a self-review of my code.
  • I have added tests for the proposed changes.
  • I have run the tests and there are not errors.

I also updated the documentation in README.md to show this new parameter.

@codecov
Copy link

codecov bot commented Jan 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.76%. Comparing base (58f62a5) to head (6611152).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #467   +/-   ##
=======================================
  Coverage   97.76%   97.76%           
=======================================
  Files          63       63           
  Lines        2011     2012    +1     
=======================================
+ Hits         1966     1967    +1     
  Misses         45       45           
Flag Coverage Δ
unittests 97.76% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Owner

@fabiocaccamo fabiocaccamo left a comment

Choose a reason for hiding this comment

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

@kotfu thank you for this nice PR!

@fabiocaccamo fabiocaccamo merged commit cd5117e into fabiocaccamo:main Jan 18, 2025
18 checks passed
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.

2 participants