- Add support for Python 3.8 through 3.11
- Dropped support for Python 2 and <=3.6
- Dependency updates and various compatibility fixes
- Report a better error message for bad includes.
- Added support for hashed fields, structs, and unions for improved compatibility with Python 3.
- Fixed a bug in setup.py that caused failures if the version of Cython being used was a pre-release or a post-release.
- Fixed bug which caused unrecognized enums to throw exceptions.
- Add support for string enums in from_primitive.
- Added support for Python 3.7.
- Removed support for PyPy.
- Removed support for Python 3.3, which has been EOLed as of 2017-09-29.
- Fixed a bug where errors while parsing certain parts of the Thrift payload would be ignored.
- Fixed a bug that caused a segfault if a return value was received for a
void
function.
- Further optimizations to the serialization path to reduce unnecessary python interaction, improving benchmark performance another 4x.
- Optimize deserialization path by doing validation inline at construction time. This improves deserialization benchmark performance by 2x.
- Optimized serialization and deserialization performance by removing an unnecessary intermediate layer.
- Optimized validation at object construction time by skipping the parsing of nested structs and unions since they would have been validated already anyway.
- Due to build incompatibility issues, pypy3 support is temporarily being dropped. The library is unlikely to break, but no guarantees exist.
- Changed
PrimitiveTypeSpec.validate()
to check that the values of integer fields fit in the required number of bits. - Include the field ID and struct name in the exception messages from
StructTypeSpec.validate()
.
- Fixed a bug that caused mutations to default values of structs to be persisted across calls.
- Fixed a bug where the
strict
flag was not respected for exceptions.
- Fixed a bug that caused optional arguments to show up out of order in
struct
docstrings.
- Fixed bug where
Decimal
andFraction
values were disallowed forfloat
fields.
- Re-add the changes from 1.2.0 with a fix. Serialization and deserialization should be fast again.
- Revert changes made in 1.2.0 because they unintentionally break some str/unicode concerns in TypeSpecs.
- Serialization and deserialization to and from binary is now almost twice as fast.
- Expose
result_type
on the args type for service functions. - Expose
service
on function spec. - Expose the contents of the Thrift file on compiled modules under the
__thrift_source__
attribute. - Expose a reference back to the module on generated types as
__thrift_module__
. - Don't fail compilation if fields in unions specify themselves as
optional
. - Added
i8
as an alias forbyte
in Thrift files. - Allow multiple enum items to have the same value.
- Fixed a bug where the line number of constant lists and maps was incorrect in the AST.
- Fixed bug where type annotations without values weren't supported by the grammar.
include
statements are now supported. For more information, see :ref:`including-modules`.- Added support for message envelopes. This makes it possible to talk with standard Apache Thrift services and clients. For more information, see :ref:`calling-apache-thrift`.
- Constant and default values may now be structs or unions, represented in the Thrift file as maps with string keys.
- Significant performance improvements to the
BinaryProtocol
implementation. - Removed
thriftrw.wire.TType
in favor of thethriftrw.wire.ttype
module. MapValue
now containsMapItem
objects instead of key-value tuple pairs.- Request and response
TypeSpecs
now have a reference back to theFunctionSpec
. ServiceSpec
now provides alookup
method to look upFunctionSpecs
by name.- Removed the
force
option onLoader.load
. - In generated modules, renamed the
types
,constants
andservices
attributes to__types__
,__constants__
, and__services__
.
- Fixed a bug which prevented default values for enums from being plain integers.
- Fix a bug in the parser that prevented starting identifier names with
true
orfalse
. - Allow passing 0 and 1 as default values for
bool
. These will automatically be cast to boolean.
- Core modules have been cythonized for additional performance improvements.
- Breaking All custom exceptions are exported by the
thriftrw.errors
module only. This includesThriftProtocolError
andEndOfInputError
. UnknownExceptionError
is now raised if an unrecognized exception is encountered while parsing service method responses.
- Lists and sets now allow arbitrary iterables as input.
- Lists may be used to provide default values for sets.
- Now uses
io.BytesIO
for speed improvements in Python 2. - Fixed a bug which allowed empty responses for non-void methods.
- Fixed a bug which caused the
eq
methods for structs, unions, and exceptions to raiseAttributeError
if the value being compared was of the wrong type.
- Added an option to disable "required/optional" strictness on structs.
- Added
to_primitive
andfrom_primitive
methods to generated types to allow converting struct, union, and exception values to and from primitive representations. - Added a
validate
method to allTypeSpecs
. - Changed to perform validation during struct, union, or exception construction instead of performing it during serialization.
- Allow unicode to be passed for
binary
types.
- Default values for binary fields are no longer unicode.
- Backwards compatibility for Python 2.7.6 and earlier due to Python #19099.
- Allow binary values to be passed for
string
types.
- Support
oneway
functions.
- Export a mapping of constants in the generated module under the
constants
attribute. - Added
thriftrw.install
to install a Thrift file as a submodule of a module. - Expose
thriftrw.spec.FunctionResultSpec
with information on the return and exception types of the function.
- Initial release.