fix: name a list entry whose comparison raises in a settings difference

Open Beginner friendly
#142 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
django, python
Domain
backend

Research direction

Start by reading _configure._difference in neolith/_configure.py, focusing on the list comparison and the guarded scalar comparison below it. Reproduce the failure with the example in the issue, then check the existing tests for settings differences. Done means the list comparison reports the difference by path without exposing the value or comparison error text.

Written by the indexing model from the issue text.

Description

help wanted

In _configure._difference, a list entry that holds a value whose __eq__ raises escapes with that error's own message, instead of being named as a difference. The list branch compares have != want unguarded; the scalar branch below it guards the same comparison.

Reproduction, on release/0.1.0a3:

from neolith._configure import _difference

class Loud:
    __hash__ = None
    def __eq__(self, other):
        raise ValueError("secret")

_difference({"a": [[Loud()]]}, {"a": [["x"]]})
# ValueError: secret

Expected: a difference named by its path, with no value and no error text.

Dominant language
Python
Stars
1
Forks
0
Avg merge
5h 30m
Merged PRs (30d)
85

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from stack314/django-neolith

All issues in stack314/django-neolith

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.