Skip to content

Add ignore_key_func#63

Open
jinoobaek-qz wants to merge 2 commits into
amirziai:masterfrom
jinoobaek-qz:ignore_key_func
Open

Add ignore_key_func#63
jinoobaek-qz wants to merge 2 commits into
amirziai:masterfrom
jinoobaek-qz:ignore_key_func

Conversation

@jinoobaek-qz

Copy link
Copy Markdown

Summary

This PR intends to add the functionality to ignore any key within any depth of the hierarchy via passing a callable that returns a boolean to determine whether it should ignore a key or not.

The specific use-case that I have here is to ignore all keys that start with a specific substring. However, I wanted to leave enough room to allow different types of behavior e.g. prefix, suffix, whole string, and/or containment check.

Bug Fixes/New Features

  • Ignore key at any level of the dictionary hierarchy

How to Verify

Added a new unit test. All unit tests should pass.

Side Effects

Should not have any side effects to existing call behaviors.

Resolves

None

Tests

Added test_keys_to_ignore
Augmented test_flatten_ignore_keys (to catch converse behavior)

Code Reviewer(s)

@amirziai

@pep8speaks

pep8speaks commented Jan 29, 2020

Copy link
Copy Markdown

Hello @jinoobaek-qz! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2020-01-29 07:15:28 UTC

@jinoobaek-qz
jinoobaek-qz requested a review from amirziai January 29, 2020 07:14
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