|
68 | 68 | { |
69 | 69 | "data": { |
70 | 70 | "text/plain": [ |
71 | | - "<refinitiv.data._data.core.session._platform_session.PlatformSession at 0x2442e0461c0>" |
| 71 | + "<refinitiv.data._data.core.session._platform_session.PlatformSession at 0x25afe81da30>" |
72 | 72 | ] |
73 | 73 | }, |
74 | 74 | "execution_count": 2, |
|
414 | 414 | }, |
415 | 415 | { |
416 | 416 | "cell_type": "code", |
417 | | - "execution_count": null, |
| 417 | + "execution_count": 3, |
418 | 418 | "metadata": {}, |
419 | | - "outputs": [], |
| 419 | + "outputs": [ |
| 420 | + { |
| 421 | + "data": { |
| 422 | + "text/html": [ |
| 423 | + "<div>\n", |
| 424 | + "<style scoped>\n", |
| 425 | + " .dataframe tbody tr th:only-of-type {\n", |
| 426 | + " vertical-align: middle;\n", |
| 427 | + " }\n", |
| 428 | + "\n", |
| 429 | + " .dataframe tbody tr th {\n", |
| 430 | + " vertical-align: top;\n", |
| 431 | + " }\n", |
| 432 | + "\n", |
| 433 | + " .dataframe thead th {\n", |
| 434 | + " text-align: right;\n", |
| 435 | + " }\n", |
| 436 | + "</style>\n", |
| 437 | + "<table border=\"1\" class=\"dataframe\">\n", |
| 438 | + " <thead>\n", |
| 439 | + " <tr style=\"text-align: right;\">\n", |
| 440 | + " <th></th>\n", |
| 441 | + " <th>Instrument</th>\n", |
| 442 | + " <th>BID</th>\n", |
| 443 | + " <th>ASK</th>\n", |
| 444 | + " </tr>\n", |
| 445 | + " </thead>\n", |
| 446 | + " <tbody>\n", |
| 447 | + " <tr>\n", |
| 448 | + " <th>0</th>\n", |
| 449 | + " <td>EUR=</td>\n", |
| 450 | + " <td>1.1939</td>\n", |
| 451 | + " <td>1.1943</td>\n", |
| 452 | + " </tr>\n", |
| 453 | + " <tr>\n", |
| 454 | + " <th>1</th>\n", |
| 455 | + " <td>GBP=</td>\n", |
| 456 | + " <td>1.3908</td>\n", |
| 457 | + " <td>1.3912</td>\n", |
| 458 | + " </tr>\n", |
| 459 | + " <tr>\n", |
| 460 | + " <th>2</th>\n", |
| 461 | + " <td>BADRIC</td>\n", |
| 462 | + " <td><NA></td>\n", |
| 463 | + " <td><NA></td>\n", |
| 464 | + " </tr>\n", |
| 465 | + " </tbody>\n", |
| 466 | + "</table>\n", |
| 467 | + "</div>" |
| 468 | + ], |
| 469 | + "text/plain": [ |
| 470 | + " Instrument BID ASK\n", |
| 471 | + "0 EUR= 1.1939 1.1943\n", |
| 472 | + "1 GBP= 1.3908 1.3912\n", |
| 473 | + "2 BADRIC <NA> <NA>" |
| 474 | + ] |
| 475 | + }, |
| 476 | + "execution_count": 3, |
| 477 | + "metadata": {}, |
| 478 | + "output_type": "execute_result" |
| 479 | + } |
| 480 | + ], |
420 | 481 | "source": [ |
421 | 482 | "# Define our Streaming Price object\n", |
422 | 483 | "mixed = rd.content.pricing.Definition(\n", |
423 | | - " ['EUR=', 'GBP=', 'DUMMY'],\n", |
| 484 | + " ['EUR=', 'GBP=', 'BADRIC'],\n", |
424 | 485 | " fields=['BID', 'ASK']\n", |
425 | 486 | ").get_stream()\n", |
426 | 487 | "# Open the Stream - Once opened, the library starts caching the updates\n", |
|
437 | 498 | }, |
438 | 499 | { |
439 | 500 | "cell_type": "code", |
440 | | - "execution_count": null, |
| 501 | + "execution_count": 5, |
441 | 502 | "metadata": {}, |
442 | | - "outputs": [], |
| 503 | + "outputs": [ |
| 504 | + { |
| 505 | + "data": { |
| 506 | + "text/plain": [ |
| 507 | + "{'status': <StreamState.Closed: 1>,\n", |
| 508 | + " 'code': 'NotFound',\n", |
| 509 | + " 'message': '**The record could not be found'}" |
| 510 | + ] |
| 511 | + }, |
| 512 | + "execution_count": 5, |
| 513 | + "metadata": {}, |
| 514 | + "output_type": "execute_result" |
| 515 | + } |
| 516 | + ], |
443 | 517 | "source": [ |
444 | | - "mixed['DUMMY'].state" |
| 518 | + "mixed['BADRIC'].status" |
445 | 519 | ] |
446 | 520 | }, |
447 | 521 | { |
448 | 522 | "cell_type": "markdown", |
449 | 523 | "metadata": {}, |
450 | 524 | "source": [ |
451 | | - "For an invalid instrument you should see: \n", |
| 525 | + "As you will note, for an invalid instrument we get: \n", |
452 | 526 | "{'status': <StreamState.Closed: 1>, **'code': 'NotFound'**, 'message': '** The Record could not be found'} \n", |
| 527 | + "\n", |
453 | 528 | "However, if you are not licensed for the instrument you would see something like: \n", |
454 | 529 | "{'status': <StreamState.Closed: 1>, **'code': 'NotEntitled'**, 'message': 'A21: DACS User Profile denied access to vendor'} \n", |
455 | | - "**NOTE**: Do not rely on the message text to remain unchanged, use the **code** value for any programmatic decision making." |
| 530 | + "**NOTE**: The exact wording of **message** can change over time - therefore,only use the **code** value for any programmatic decision making." |
456 | 531 | ] |
457 | 532 | }, |
458 | 533 | { |
|
464 | 539 | }, |
465 | 540 | { |
466 | 541 | "cell_type": "code", |
467 | | - "execution_count": null, |
| 542 | + "execution_count": 6, |
468 | 543 | "metadata": { |
469 | 544 | "pycharm": { |
470 | 545 | "name": "#%%\n" |
|
0 commit comments