Missing Key 'n' in entity mapping
See original GitHub issueHi!
It looks like web api was updated recently, with two extra fields: ‘n’, ‘vw’
{'t': '2021-06-28T04:00:00Z', 'o': 10.15, 'h': 10.3, 'l': 10.04, 'c': 10.04, 'v': 20356, 'n': 111, 'vw': 10.113978}
So now conversion to pandas dataframe using ‘.df’ method fails with exception
Traceback (most recent call last):
File "\divscan.py", line 548, in <module>
File "\divscan.py", line 293, in prepareData
data = fetchDelta(ticker, TimeFrame.Day, minBars, past, now)
File "\divscan.py", line 279, in fetchDelta
df = fetchData(ticker, tf, start, end)
File "\divscan.py", line 258, in fetchData
return data.df
File "\lib\site-packages\alpaca_trade_api\entity_v2.py", line 61, in df
df.columns = [self.mapping[c] for c in df.columns]
File "\lib\site-packages\alpaca_trade_api\entity_v2.py", line 61, in <listcomp>
df.columns = [self.mapping[c] for c in df.columns]
KeyError: 'n'
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Mapping entity without key - Stack Overflow
I've got two tables in database: Table A (parent) has a primary key column and Table B (child) doesn't have a key at...
Read more >Data Mapping Troubleshooting - Amazon AWS
For an Unfamiliar Dimension that has multiple values for every Entity Key, you may notice that you have 'lost' Dimension values i.e., instead...
Read more >Entity Types - EF Core - Microsoft Learn
How to configure and map entity types using Entity Framework Core. ... If no DbSet exists for the given entity, the class name...
Read more >Hibernate Mapping Exception – Unknown Entity - Baeldung
MappingException : Unknown entity issue and solutions, both for Hibernate as well as for a Spring and Hibernate environment.
Read more >Configuring One To Many Relationships in Entity Framework ...
The With side of the relationship is represented by the WithOne and ... defined in the dependent entity ( Employee ) but no...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Simple solution:
I dont want to speculate but this API returns exactly what the Polygon API aggregate_bars API returns.
VW stands for volume weighted average price.
https://polygon.io/docs/get_v2_aggs_ticker__stocksTicker__range__multiplier___timespan___from___to__anchor