Open bh2smith opened 1 year ago
this actually works perfectly for python >= 3.10
# Decorator to skip write on empty data sets. # TODO - this cool decorator only works for python >= 3.10 # @staticmethod def _skip_empty(write_like: WriteLikeSignature) -> WriteLikeSignature: def wrapper( self: FileIO, data: List[DuneRecord], name: str, ftype: FileType ) -> None: if len(data) == 0: logger.info(f"Nothing to write to {name}... skipping") return write_like(self, data, name, ftype) return wrapper
Unfortunately it fails for any earlier version with
TypeError: 'staticmethod' object is not callable
Here is an issue about it:
https://bugs.python.org/issue43682
Originally posted by @bh2smith in https://github.com/cowprotocol/dune-client/issues/37#issuecomment-1319901120
Unfortunately it fails for any earlier version with
Here is an issue about it:
https://bugs.python.org/issue43682
Originally posted by @bh2smith in https://github.com/cowprotocol/dune-client/issues/37#issuecomment-1319901120