Remove the top-level delivery_report() function
Top-level function outside Class: def delivery_report(err, msg):
Inside RideAvroProducer class:
@staticmethod
def delivery_report(err, msg):
Use the existing @staticmethod inside the class
Update the produce() method to call:
on_delivery=self.delivery_report
This keeps the codebase clean, improves encapsulation, and avoids confusion about which version is active.