|
1691 | 1691 | "ld.close_session()" |
1692 | 1692 | ] |
1693 | 1693 | }, |
| 1694 | + { |
| 1695 | + "cell_type": "markdown", |
| 1696 | + "id": "8d050ac7", |
| 1697 | + "metadata": {}, |
| 1698 | + "source": [ |
| 1699 | + "## What about the list of RICs?\n", |
| 1700 | + "\n", |
| 1701 | + "The Historical Pricing definitions universe parameter accept both single-RIC and list-of-RICs inputs.\n", |
| 1702 | + "\n", |
| 1703 | + "**Single-RIC approach** (recommended): Each request returns its own dataframe and raw json response, making it easy to handle successes and failures individually.\n", |
| 1704 | + "\n", |
| 1705 | + "**List-of-RICs approach**: A single request returns a [multi-index](https://pandas.pydata.org/docs/user_guide/advanced.html#multiindex-advanced-indexing) dataframe with data from all RICs combined along with an array of JSON data. This is harder to manage and parse errors per individual instrument.\n", |
| 1706 | + "\n", |
| 1707 | + "**Recommendation**: Use multiple single-RIC requests with `asyncio.gather()` for better control and error handling." |
| 1708 | + ] |
| 1709 | + }, |
1694 | 1710 | { |
1695 | 1711 | "cell_type": "markdown", |
1696 | 1712 | "id": "79d61f12", |
|
1724 | 1740 | "- Monitoring jobs where partial data is still valuable.\n", |
1725 | 1741 | "- Exploratory workflows where you want both data and errors in one run.\n", |
1726 | 1742 | "\n", |
| 1743 | + "### Performance\n", |
| 1744 | + "\n", |
| 1745 | + "Please check the [ld_notebook_gather_performance.ipynb](./ld_notebook_gather_performance.ipynb) for the 30 instruments interday requests demonstration.\n", |
| 1746 | + "\n", |
| 1747 | + "The performance demonstration notebook uses `response.data.raw` statement to display the raw output data in JSON format. If you instead use `response.data.df` statement to retrieve the data as a DataFrame, please note that additional time is required to convert the JSON data into a DataFrame.\n", |
| 1748 | + "\n", |
1727 | 1749 | "### Important note\n", |
1728 | 1750 | "\n", |
1729 | 1751 | "`return_exceptions=True` does not hide errors. It returns them as list items, so your code should explicitly handle both successful responses and exceptions." |
|
1747 | 1769 | "\n", |
1748 | 1770 | "Among these approaches, `TaskGroup` is now a common choice and is frequently compared with `gather` in modern asyncio design discussions.\n", |
1749 | 1771 | "\n", |
1750 | | - "In the next section, I will show how to use Data Library Historical Pricing `get_data_async` with `asyncio.TaskGroup`." |
| 1772 | + "### What Next?\n", |
| 1773 | + "\n", |
| 1774 | + "I will show how to use Data Library Historical Pricing `get_data_async` with `asyncio.TaskGroup`." |
1751 | 1775 | ] |
| 1776 | + }, |
| 1777 | + { |
| 1778 | + "cell_type": "markdown", |
| 1779 | + "id": "2993b364", |
| 1780 | + "metadata": {}, |
| 1781 | + "source": [] |
1752 | 1782 | } |
1753 | 1783 | ], |
1754 | 1784 | "metadata": { |
|
0 commit comments