I have some azure function app that is supposed to be triggered by the blob. The idea is that every time something lands on the blob (those should only be excel files), the function runs and does some processing.
def main(myblob: func.InputStream):
logging.info(f"Python blob trigger function processed blob \n"
f"Name: {myblob.name}\n"
f"Blob Size: {myblob.length} bytes"
f"Returns:{myblob.read}")
#read new data and replace nan with none values
data = pd.read_excel(myblob)
data = data.where(pd.notnull(data), None)
#processing
This code worked for me during testing. However, I have just received an edited file from someone else and got Exception: XLRDError: Unsupported format, or corrupt file: Expected BOF record; found b'\xef\xbb\xbfName,'
In the end, this is meant to be used by more people who will upload these files so I have to make sure it works every time. However, I do not see any pattern here. It works for one spreadsheet and fails for another.