`LeanData.TryParsePath` fails on an absolute universe file path
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 78/100
Direzione di ricerca
L'indice fisso filePathParts[2] usato per il mercato si trova in ParseUniversePath, che viene chiamato da LeanData.TryParsePath. Leggi prima TryParsePath per capire dove viene trovato startIndex, poi passa il mercato a partire da startIndex + 1 invece dell'indice fisso. Aggiungi i due casi a LeanDataTests.UniversesDataPath ed esegui quel test; è completato quando tutti gli 8 casi passano.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Expected Behavior
LeanData.TryParsePath parses a universe file path wherever the data folder sits, for example /Lean/Data/option/usa/universes/aapl/20241112.csv. The market is usa.
Actual Behavior
TryParsePath returns false for that path. ParseUniversePath takes the market from a fixed index, filePathParts[2]. That index holds the market only when the path has exactly 1 folder before the security type, as in Data/option/usa/.... For /Lean/Data/option/usa/..., index 2 is option, so the market is option.
DownloaderDataProvider.Fetch calls TryParsePath on the file key. In the engine image the data folder is /Lean/Data, so a missing universe file looks like it is not downloaded. A backtest logs this line once:
ERROR:: LocalDiskMapFileProvider.GetMapFileResolver(option): The specified directory does not exist: /Lean/Data/equity/option/map_files
Potential Solution
TryParsePath already finds the position of the security type, startIndex. Pass the market from info[startIndex + 1] to ParseUniversePath, or pass startIndex, in place of the fixed index.
Reproducing the Problem
Add these 2 cases to LeanDataTests.UniversesDataPath:
[TestCase("/Lean/Data/option/usa/universes/aapl/20241112.csv", SecurityType.Option, Market.USA, Resolution.Daily, "AAPL", "2024/11/12", false)]
[TestCase("/Lean/Data/future/cme/universes/es/20111230.csv", SecurityType.Future, Market.CME, Resolution.Daily, "ES", "2011/12/30", false)]
On master at 138382568, both new cases fail on Assert.IsTrue(LeanData.TryParsePath(...)), and the 6 existing cases pass:
Expected: True
But was: False
I saw the log line above in a daily option backtest with a downloader data provider, in a local build. A run of the same algorithm with the local data provider did not log it.
System Information
Windows 11, .NET SDK 10.0.403, master at 138382568. The log line came from the engine image, on Linux.
Checklist
- I have completely filled out this template
- I have confirmed that this issue exists on the current
masterbranch - I have confirmed that this is not a duplicate issue by searching issues
- I have provided detailed steps to reproduce the issue
- Lingua principale
- C#
- Stelle
- 22.3k
- Fork
- 5.4k
- Merge medio
- 1g 15h
- PR unite (30g)
- 51
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di QuantConnect/Lean
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
QuantConnect/Lean#9965 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
QuantConnect/Lean#9955 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
QuantConnect/Lean#9953 ·
I maintainer di solito rispondono entro 1 giorno
-
WebullFeeModel charges SPXW options the SPX exchange feeForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
QuantConnect/Lean#9922 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
library-request
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
QuantConnect/Lean#9879 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di QuantConnect/Lean
Issue simili
-
bug needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
microsoft/microsoft-ui-xaml#12515 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 2 giorni
-
[v5-preview5] `func new` displays incorrect command in error message when project is not initializedApertaNeeds: Triage (Functions) v5 v5-preview5
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
Azure/azure-functions-core-tools#5838 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
customer-reported needs-team-triage question server-Azure.Mcp tools-Pricing
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
microsoft/mcp#4087 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Enable "remote"' featureAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100