Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

QuiverInsiderTrading readers throw (fatal) on rows in a legacy column layout; validate column count and return null

Abierto
#12 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
72/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
csharp

Línea de trabajo

Start with QuiverInsiderTradingUniverse.cs:150 and QuiverInsiderTrading.cs, then review the cited SubscriptionDataReader.cs handling of BaseData.Reader returning null. Reproduce the malformed rows over the 2026-07-27 to 2026-08-05 window; done means unexpected column counts or unparseable fields are skipped without a reader exception, while the current layouts still produce data points.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Summary

Both QuiverInsiderTradingUniverse.Reader and QuiverInsiderTrading.Reader assume every CSV line is in the current 16-column (universe) / 15-column (per-ticker) layout. A line in any other shape throws out of the reader, and LEAN treats a reader exception as a fatal runtime error (SubscriptionDataReader.cs:551 -> ReaderErrorDetected -> IResultHandler.RuntimeError), so one stray row in one daily file stops every algorithm that subscribes to the universe. The readers should validate the column count and return null for a line they cannot parse, so a bad row costs one data point instead of the whole backtest.

This is a sibling of #9 (legacy 14-column rows after the Name field was added). The rows here are older still: the pre-a50ad5f1 layout, and they fail on the date parse before any index is out of range, so the hasName fallback proposed in #9 does not cover them.

Evidence

Universe file alternative/quiver/insidertrading/universe/20260731.csv on the cloud data store (read from a backtest on LEAN 2.5.0.0.18114, 2026-09-21): 663 rows, 497 in the 16-column layout and 166 in the pre-refactor 6-column layout {sid},{ticker},{name},{shares},{price},{sharesOwnedFollowing}, spanning 37 tickers. Example:

ASPS UF02B1SL6QG5,ASPS,winkler matthew t.,1000.0,5.045,39989.0

The matching per-ticker file asps.csv carries the same trades twice: once in the 15-column layout and once as 5-column {date},{name},{shares},{price},{sharesOwnedFollowing} rows:

20260731,,20260730,P,5.045,1000.0,39989.0,A,D,Winkler Matthew T.,,T,F,F,F
20260731,winkler matthew t.,1000.0,5.045,39989.0

Every other universe file from 2026-05-01 to 2026-09-19 (99 files) is 16-column only, so the stray rows come from a single run of a pre-refactor build (the redundancy job for this dataset is still pinned to 6d71e402, which predates a50ad5f1) for upload date 2026-07-31; ProcessUniverse() then copied them into the universe file because it keys rows on the first column only (QuiverInsiderTradingDataDownloader.cs:219-251).

Reader failure, QuiverInsiderTradingUniverse.cs:150: csv[2] is winkler matthew t. on a 6-column row, and Parse.DateTimeExact(s, "yyyyMMddHHmmss") throws:

Error invoking QUIVERINSIDERTRADINGUNIVERSE-USA-... .QuiverInsiderTradingUniverse 2S data reader. Line: ASPS UF02B1SL6QG5,ASPS,winkler matthew t.,1000.0,5.045,39989.0 Error: String 'winkler matthew t.' was not recognized as a valid DateTime.

Same for the per-ticker reader, QuiverInsiderTrading.cs (csv[1] parsed as yyyyMMddHHmmss):

Error invoking ASPS.QuiverInsiderTrading data reader. Line: 20260731,winkler matthew t.,701.0,5.1,38989.0 Error: String 'winkler matthew t.' was not recognized as a valid DateTime.

Reproduced in a cloud backtest with AddUniverse<QuiverInsiderTradingUniverse>(_ => Enumerable.Empty<Symbol>()) over 2026-07-27 to 2026-08-05, and with AddData<QuiverInsiderTrading>("ASPS") over the same window. Note that the read-ahead worker (SubscriptionUtils.CreateAndScheduleWorker) stamps the runtime error with the algorithm clock, so a reporter sees the failure "on" an earlier date than the file that holds the row (here 2026-07-07, because there are no universe files between 2026-07-09 and 2026-07-26).

Proposed change

  1. In both readers, check csv.Length against the expected column count first and return null (optionally Log.Error once per file) when it does not match, instead of letting the parse throw. BaseData.Reader returning null is already handled by TextSubscriptionDataSourceReader as "no data point". Combined with the #9 fallback this makes the readers tolerant of every layout the store has carried.
  2. Wrap the Parse.DateTimeExact / decimal.Parse calls so a single unparseable field also yields null rather than an exception.
  3. Separately (data side, not this repo): strip the 5-column rows from the 37 per-ticker files and let ProcessUniverse() regenerate 20260731.csv; repoint the redundancy job at the current commit so a pre-refactor build cannot write again.

Open questions

  • Should ProcessUniverse() itself skip lines whose column count does not match the current layout, so a per-ticker file with stray rows cannot poison the universe file? It already skips lines whose first column is not a yyyyMMdd date.

Reference

Intercom conversation: 215476021685114.

Lenguaje dominante
C#
Estrellas
0
Forks
3
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de QuantConnect/Lean.DataSource.QuiverQuant

Todos los issues de QuantConnect/Lean.DataSource.QuiverQuant

Issues similares

Más issues de C#

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.