cloudevents / cloudevents/sdk-python

CloudEvent equality is incorrect on none attributes

Open
#199 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
342
Forks
65
PR merge metrics
No merged PRs in 30d

Description

CloudEvent equality is incorrect on none attributes

from cloudevents.http import CloudEvent
CloudEvent(attributes={"type": "a", "source": "a", "a": None}) == CloudEvent({"type": "a", "source":"a"})

expected True

actual False

the spec says that null value attributes are the same as non-existing attributes

Contributor guide

Open the contributing guide

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.

Research direction

Start at the CloudEvent equality implementation and reproduce the comparison in the issue using the Python SDK. Add coverage for an attribute set to None versus an absent attribute, and confirm the comparison matches the CloudEvents specification and the expected True result.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.