Failure on submission

I have passes 21 out of 22 unit tests
Last test is NoEndDateData which keeps giving failure.
I have tried multiple times using debugger and fixing my code at various places.
Spent a long time on this one, can anyone tell me why I am getting error on this test. I can’t figure it out. Pls help needed

If last date is not there is in the data. You need to extract the data for the latest date