How a Decorator Crashed My Flask App: Lessons Learned
TL;DR: Always use functools.wraps for your decorators. Decorators in python are wonderful. They let you modify or extend the behavior of functions or methods without permanently modifying their source code. I’ve used them in several places in my code to add features to my functions. But recently, I came across a weird, or rather interesting, bug that I felt was worth sharing. The Issue So we had a Flask API that was responsible for ML inference....