make bid/ask optional in PolygonStockQuoteWebSocketData

This commit is contained in:
Danglewood
2024-11-12 10:35:41 -08:00
parent 2e4d693071
commit b69cba831b
3 changed files with 12 additions and 9 deletions

View File

@@ -77,7 +77,7 @@ The table below is not intended as a source of truth.
Availability will depend on the access level permitted by the provider's API key.
#### Usage
#### Example
```python
conn = obb.websockets.create_connection(provider="tiingo", asset_type="crypto", symbol="*", feed="trade", start_broadcast=True)

View File

@@ -8,10 +8,7 @@ from typing import Any, Literal, Optional
from openbb_core.app.model.abstract.error import OpenBBError
from openbb_core.provider.abstract.data import Data
from openbb_core.provider.abstract.fetcher import Fetcher
from openbb_core.provider.utils.descriptions import (
DATA_DESCRIPTIONS,
QUERY_DESCRIPTIONS,
)
from openbb_core.provider.utils.descriptions import DATA_DESCRIPTIONS
from openbb_polygon.utils.constants import (
CRYPTO_EXCHANGE_MAP,
FX_EXCHANGE_MAP,
@@ -775,18 +772,22 @@ class PolygonStockQuoteWebSocketData(WebSocketData):
bid_exchange: str = Field(
description="The exchange where the bid originated.",
)
bid_size: float = Field(
bid_size: Optional[float] = Field(
default=None,
description="The size of the bid.",
)
bid: float = Field(
bid: Optional[float] = Field(
default=None,
description="The bid price.",
json_schema_extra={"x-unit_measurement": "currency"},
)
ask: float = Field(
ask: Optional[float] = Field(
default=None,
description="The ask price.",
json_schema_extra={"x-unit_measurement": "currency"},
)
ask_size: float = Field(
ask_size: Optional[float] = Field(
default=None,
description="The size of the ask.",
)
ask_exchange: str = Field(

View File

@@ -155,9 +155,11 @@ STOCK_QUOTE_CONDITIONS = {
90: "Syndicate Bid",
91: "Pre Syndicate Bid",
92: "Penalty Bid",
95: "CQS Generated",
}
STOCK_QUOTE_INDICATORS = {
1: "EXCHANGE_ACQUISITION",
601: "NBBO_NO_CHANGE",
602: "NBBO_QUOTE_IS_NBBO",
603: "NBBO_NO_BB_NO_BO",