Checklist
Steps to reproduce
The models documentation on dumps() for JSON serializing does not state about the include_metadataargument. This is also the case in Models, Serialization, and Codecs section of the documentation.
>>> class LogEvent(Record, serializer='json'):
... severity: str
... message: str
... timestamp: float
... optional_field: str = 'default value'
...
>>> event = LogEvent(
... severity='error',
... message='Broken pact',
... timestamp=666.0,
... )
>>> event.dumps()
b'{"severity": "error", "message": "Broken pact", "timestamp": 666.0, "optional_field": "default value", "__faust": {"ns": "__main__.LogEvent"}}'
Expected behavior
Expected behavior as per the actual documentation is:
>>> event.dumps()
b'{"severity": "error", "message": "Broken pact", "timestamp": 666.0, "optional_field": "default value"}'
Actual behavior
The include_metadata=False additional argument is necessary to get the expected behavior. It is undocumented though.
Versions
- Python version: 3.8.5
- Faust version: 1.10.4
- Operating system: MacOS Catalina
- Kafka version: 2.6.0
- RocksDB version (if applicable): N/A
Checklist
masterbranch of Faust.Steps to reproduce
The models documentation on dumps() for JSON serializing does not state about the
include_metadataargument. This is also the case in Models, Serialization, and Codecs section of the documentation.Expected behavior
Expected behavior as per the actual documentation is:
Actual behavior
The
include_metadata=Falseadditional argument is necessary to get the expected behavior. It is undocumented though.Versions