[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
9b8df1e0e7
commit
488d737b6b
|
@ -121,7 +121,7 @@ class HTTPCloudEvent:
|
||||||
headers: list
|
headers: list
|
||||||
body: Any # unsure about typing here
|
body: Any # unsure about typing here
|
||||||
|
|
||||||
|
|
||||||
def to_binary(event: CloudEvent) -> HTTPCloudEvent:
|
def to_binary(event: CloudEvent) -> HTTPCloudEvent:
|
||||||
e = event.to_dict()
|
e = event.to_dict()
|
||||||
# logic to marshall into http binary output
|
# logic to marshall into http binary output
|
||||||
|
@ -169,9 +169,9 @@ def from_binary(headers: list, body: dict, event_types: Optional[dict[str, type]
|
||||||
event_as_dict = {}
|
event_as_dict = {}
|
||||||
# specific logic to unmarshall raw headers into a dictionary
|
# specific logic to unmarshall raw headers into a dictionary
|
||||||
if event_types:
|
if event_types:
|
||||||
# Use
|
# Use
|
||||||
return event_types.get(event_as_dict['type'], CloudEvent).from_dict(e)
|
return event_types.get(event_as_dict['type'], CloudEvent).from_dict(e)
|
||||||
else:
|
else:
|
||||||
return CloudEvent.from_dict(e)
|
return CloudEvent.from_dict(e)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue