-
Notifications
You must be signed in to change notification settings - Fork 733
Wordlift #556
base: main
Are you sure you want to change the base?
Wordlift #556
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did one comment, adding async not sounds a big deal. but I'm curious to understand better what you want to achieve
response = await asyncio.to_thread( | ||
requests.post, | ||
self.endpoint, | ||
json={"query": query}, | ||
headers=self.headers, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the reason to run the request on another thread? or add async operations?
quick bump @msftwarelab |
bump @msftwarelab |
Sorry for late response @EmanuelCampos |
Thanks for the explanation @msftwarelab I understand the problem, but we have some issues with eg: OnDemandLoader runs synchronously And probably on other Tools which I'm not able to find now but that needs to run synchronously Maybe a solution would be to set a read timeout on the will cc: @logan-markewich on this one |
Thank you for your kind response! @EmanuelCampos |
@msftwarelab Hmm, yea I'd say to implement both load_data and aload_data In most cases, load_data() can call the aload_data() using asyncio.run() to run the async method. You could even use asyncio.run() for the underlying fetch_data function if you wanted. We should probably update the base class to make this more clear |
quick bump @msftwarelab |
Description
Modifies the usage of the reader and methods of url handling.
How Has This Been Tested?
I tested with the sample data and all worked fined.