Skip to content

Conversation

DagaBhai
Copy link

Issue #23

Solution

  • added feature partial key if its a partial match in find_key
  • also added partial key and case sensitive to get more precise results

Changes

  • changes made in the function find_key and _stack_all_key_values_in_dict

tests

  • made a test file test_parser_partial and ran it locally passed all the test cases (should i also added the test in this PR??)

if any changes or suggestion do let me know

@ctomkow
Copy link
Owner

ctomkow commented Oct 17, 2025

Hi @DagaBhai, please include your unit test file as well. That will help with my review. Thanks.

@DagaBhai
Copy link
Author

ok

@DagaBhai
Copy link
Author

DagaBhai commented Oct 18, 2025

@ctomkow pls review the changes

@ctomkow
Copy link
Owner

ctomkow commented Oct 20, 2025

@DagaBhai Good work so far. Here are some comments for improvements of your pull request.

When running all the tests, some break. This is due to the new parameters introduced partial and case_sensitive which are currently mandatory.

  • They should be optional as to not break existing use of the library.
  • Also, ensure the type-hinting is updated as well (the line just below the function def line. This type of type hinting is compatible with py2.7 and beyond.
  • Finally, update the docstrings for the Parser class and the docstrings in the functions.py file for the find_key function. The new parameters partial and case_sensitive should be explained what they are and how they work.

Also, in the function _stack_all_key_values_in_dict() please simplify your code.

  • Try to adhere to the existing flow of code. i.e.
    if partial:
        match
    elif not partial:
        match
    else:
        stack_push()
        stack_trace()

Thanks!

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