Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove abc inheritance from Serializable (#8254)
Currently the Serializable class provides `serialize` and `deserialize` as `abstractmethod`s via the mechanisms afforded by inheritance from `abc.ABC`. Since this class is purely internal to `cudf` and is not describing an abstract interface in a manner useful to consumers of our code, the benefits of the abstract base class concept are outweighed by the performance and maintenance costs. In particular, `isinstance` checks on subclasses of `abc.ABC` are much more expensive than for normal classes (due to an expensive implementation of `__instancecheck__`), and (for better or worse) our code base currently makes use of these checks extensively. In addition, in certain places we can benefit from the use of custom metaclasses in `cudf`, but their usage becomes more cumbersome with `ABC` because metaclasses then also have to inherit from `ABCMeta` (which brings along any associated complexities). This PR removes that inheritance, replacing it with a much simpler approach that simply implements `serialize` and `deserialize` as raising `NotImplementedError`. Authors: - Vyas Ramasubramani (https://github.com/vyasr) Approvers: - Ashwin Srinath (https://github.com/shwina) - https://github.com/brandon-b-miller URL: #8254
- Loading branch information