def to_json(self):
        """Serialize an object to JSON based on its "properties" class
        attribute.

        :rtype: string"""

        j = {}
        for p in self.properties:
            #this logic change allows us to work with optional values for
            #this data type
            try:
                v = getattr(self, p)
            except __HOLE__:
                continue
            if v is not None:
                if p == 't':
                    j[p] = getattr(self, p).isoformat()
                else:
                    j[p] = getattr(self, p)

        return json.dumps(j)
dataset/ETHPy150Open tempodb/tempodb-python/tempodb/protocol/objects.py/DataPoint.to_json