Get "Max retries exceed" error or "NoneType" error when doing parallel parsing bundle
As the title and screenshot of the process, I'm getting some fields latest data (related to price, dividend, splits) on numbers of tickers (symbol list is d dataframe with datastream_id, and tickers, containing about 6000 symbols).
I'm using get_bundle_data in DatastreamPy, also using ProcessPoolExecutor to get data parallelly. Unfortunately, I get errors of "Max retries exceeded with url" and "NontType" error.
Best Answer
-
Thank you for reaching out to us.
It looks like to be a connection or SSL (Secure Socket Layer) issue.
Moreover, please also check the limitations of the GetDataBundle request in the DSWS user stats and limits document.
Did the problem happen when using simple requests or non-parallel requests?
1
Answers
-
Thank you for replying.
The problem didn't happen when using non-parallel requests,
but it happened when using simple requests (with parallel parsing) in the beginning.
I'm very curious about that because the problem happened "sometimes", not every time.
0 -
Thank you for replying.
The problem didn't happen when using non-parallel requests,
but it happened when using simple requests (with parallel parsing) in the beginning.
I'm very curious about that because the problem happened "sometimes", not every time.
0 -
Moreover, I think how I used to get bundle data with parallelization is similar to the sample attached which I received from your team in the past.
0 -
I can run the code properly with 3000 instruments.
import tqdm
import numpy
import pandas as pd
import DatastreamPy
from concurrent.futures import ProcessPoolExecutor
df1 = pd.read_html('list.xls')
df2 = pd.read_html('list1.xls')
df3 = pd.read_html('list2.xls')
df4 = pd.read_html('list3.xls')
df = pd.concat([df1[0], df2[0], df3[0], df4[0]], ignore_index=True)
ds = DatastreamPy.Datastream(username="username",password="password")
max_data_points = 100
request_fields=["UPO","UPH","UPL","UP","X(UVO)*1000",
"AF","PO","PH","PL","P","UDD","DD","DPS",
"DY","AND","PYD","XDD","SPLDTE","SPLFCT",
"DT","IBPDTE"]
run_symbols = df["Symbol"].tolist()
batches = numpy.array_split(run_symbols, int(numpy.ceil(len(run_symbols)/numpy.floor(max_data_points / len(request_fields)))))
total_requests = [ds.post_user_request(','.join(c), list(request_fields), kind=0, start='2023-07-11', end='2023-07-11') for c in batches]
get_ds_data_pivot = lambda per_request: ds.get_bundle_data(
[per_request])[0].drop_duplicates(subset=['Instrument','Datatype'], keep='first').pivot(index = 'Instrument',columns='Datatype',values='Value')
def get_symbol_list_and_check_time(request):
return get_ds_data_pivot(request)
def main():
with ProcessPoolExecutor(max_workers = 5) as executor:
result = list(tqdm.tqdm(executor.map(get_symbol_list_and_check_time, total_requests), desc='getting latest data', total = len(total_requests)))
if __name__ == '__main__':
main()I can't run the code on Jupyter Notebook so I ran it on the console.
Please check the version of DatastreamPy that you are using. I am using 1.0.12.
0
Categories
- All Categories
- 6 AHS
- 37 Alpha
- 161 App Studio
- 4 Block Chain
- 4 Bot Platform
- 16 Connected Risk APIs
- 47 Data Fusion
- 30 Data Model Discovery
- 608 Datastream
- 1.3K DSS
- 577 Eikon COM
- 4.9K Eikon Data APIs
- 7 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- Trading API
- 2.7K Elektron
- 1.3K EMA
- 236 ETA
- 519 WebSocket API
- 33 FX Venues
- 10 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 20 Messenger Bot
- 2 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 59 Open Calais
- 264 Open PermID
- 39 Entity Search
- 2 Org ID
- PAM
- PAM - Logging
- 8.4K Private Comments
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 20 RDMS
- 1.4K Refinitiv Data Platform
- 367 Refinitiv Data Platform Libraries
- 3 Refinitiv Due Diligence
- LSEG Due Diligence Portal API
- 3 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.1K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 10 World-Check Customer Risk Screener
- 990 World-Check One
- 44 World-Check One Zero Footprint
- 45 Side by Side Integration API
- Test Space
- 3 Thomson One Smart
- 1.2K TR Internal
- Global Hackathon 2015
- 2 Specialists Who Code
- 10 TR Knowledge Graph
- 150 Transactions
- 142 REDI API
- 1.7K TREP APIs
- 4 CAT
- 21 DACS Station
- 117 Open DACS
- 1.1K RFA
- 103 UPA
- 172 TREP Infrastructure
- 224 TRKD
- 886 TRTH
- 5 Velocity Analytics
- 5 Wealth Management Web Services
- 59 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛