I'm receiving the following error when trying to cycle through Fundamental data for the universe of symbols.  This error started over the weekend and is continued to cause errors on Monday

  1. System.Exception: N7parquet38ParquetInvalidOrCorruptedFileExceptionE (message: 'Invalid: Parquet magic bytes not found in footer. Either the file is corrupted or this is not a parquet file.') in ParquetFundamentalDataProvider.cs:line 321
  2. ---> QuantConnect.Exceptions.SystemExceptionInterpreter+SanitizedException: N7parquet38ParquetInvalidOrCorruptedFileExceptionE (message: 'Invalid: Parquet magic bytes not found in footer. Either the file is corrupted or this is not a parquet file.')
  3. at ParquetSharp.ExceptionInfo.Check(IntPtr exceptionInfo)
  4. at ParquetSharp.ExceptionInfo.Return[TArg0,TValue](IntPtr handle, TArg0 arg0, GetFunction`2 getter)
  5. at ParquetSharp.ExceptionInfo.Return[TArg0,TValue](ParquetHandle handle, TArg0 arg0, GetFunction`2 getter)
  6. at ParquetSharp.ParquetFileReader..ctor(Stream stream, ReaderProperties readerProperties, Boolean leaveOpen)
  7. at QuantConnect.Data.Common.ParquetFundamentalDataProvider.TryGetSecurityIndex(DateTime time, SecurityIdentifier key, FundamentalProperty name, Int32& index) in /LeanCloud/CI.Builder/bin/Debug/src/QuantConnect/LeanCloud.Data/QuantConnect.Data.Common/ParquetFundamentalDataProvider.cs:line 321
  8. at QuantConnect.Data.Common.ParquetFundamentalDataProvider.Get[T](DateTime time, SecurityIdentifier securityIdentifier, FundamentalProperty name) in /LeanCloud/CI.Builder/bin/Debug/src/QuantConnect/LeanCloud.Data/QuantConnect.Data.Common/ParquetFundamentalDataProvider.cs:line 136
  9. at QuantConnect.Data.UniverseSelection.FundamentalService.Get[T](DateTime time, SecurityIdentifier securityIdentifier, FundamentalProperty name) in Common/Data/UniverseSelection/FundamentalService.cs:line 84
  10. at QuantConnect.Data.Fundamental.ValuationRatios.get_BookValueYield() in Common/Data/Fundamental/Generated/ValuationRatios.cs:line 137

 

Code snippet

  1. var fundamentals = new List<Fundamental>();
  2. foreach (var equity in data.ETFConstituentsFiltered)
  3. {
  4. if (algorithm.Securities.TryGetValue(equity, out var security))
  5. {
  6. fundamentals.Add(security.Fundamentals);
  7. }
  8. }
  9. universeEquities.UpdateFundamentals(fundamentals);
  1. public void UpdateFundamentals(IEnumerable<Fundamental> fine)
  2. {
  3. foreach (var fineFundamental in fine.Where(x => x.HasFundamentalData))
  4. {
  5. var valuationRatios = fineFundamental.ValuationRatios;
  6. var bookValueYield = valuationRatios.BookValueYield;
  7. var totalYield = valuationRatios.TotalYield;
  8. var symbolData = SymbolData[fineFundamental.Symbol];
  9. symbolData.BookValueYield = bookValueYield;
  10. symbolData.TotalYield = totalYield;
  11. }
  12. }

Author

Mark Fairbrother

February 2024