Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exclude_paths example fails #85

Open
gregtkogut opened this issue Dec 9, 2024 · 2 comments
Open

exclude_paths example fails #85

gregtkogut opened this issue Dec 9, 2024 · 2 comments

Comments

@gregtkogut
Copy link

I tried to use the exclude_paths keyword in my code, and got a TypeError exception.

The README example gives the same result.

   1083     """
   1084     Computes the difference between two JSON structures using a specified JsonDiffer class.
   1085 
   (...)
   1091     :return: The computed diff.
   1092     """
-> 1093     return cls(**kwargs).diff(a, b, fp)

TypeError: JsonDiffer.__init__() got an unexpected keyword argument 'exclude_paths'
@gregtkogut
Copy link
Author

gregtkogut commented Dec 9, 2024

I resolved my issue by switching to the method used by the pytest test. So it might just be a documentation issue.

If there's concurrence I'll be happy to send a PR for the documentation.

@corytodd
Copy link
Collaborator

corytodd commented Dec 9, 2024

Agreed, the example is definitely wrong. I wonder if we should include a kwargs in the JsonDiffer constructor then also pass kwargs to the diff function? That would keep everything consistent and flexible, what do you think @payam54 ?

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

No branches or pull requests

2 participants