mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-27 12:40:35 +00:00
fix: alias credentials with uppercase (#6400)
This commit is contained in:
2
assets/extensions/provider.json
vendored
2
assets/extensions/provider.json
vendored
@@ -160,7 +160,7 @@
|
||||
},
|
||||
{
|
||||
"packageName": "openbb-polygon",
|
||||
"reprName": "Polygon",
|
||||
"reprName": "Polygon.io",
|
||||
"description": "The Polygon.io Stocks API provides REST endpoints that let you query\nthe latest market data from all US stock exchanges. You can also find data on\ncompany financials, stock market holidays, corporate actions, and more.",
|
||||
"credentials": [
|
||||
"polygon_api_key"
|
||||
|
||||
@@ -52,7 +52,7 @@ class CredentialsLoader:
|
||||
formatted[c] = (
|
||||
Optional[OBBSecretStr],
|
||||
Field(
|
||||
default=None, description=origin
|
||||
default=None, description=origin, alias=c.upper()
|
||||
), # register the credential origin (obbject, providers)
|
||||
)
|
||||
|
||||
@@ -88,7 +88,7 @@ class CredentialsLoader:
|
||||
self.from_obbject()
|
||||
return create_model( # type: ignore
|
||||
"Credentials",
|
||||
__config__=ConfigDict(validate_assignment=True),
|
||||
__config__=ConfigDict(validate_assignment=True, populate_by_name=True),
|
||||
**self.prepare(self.credentials),
|
||||
)
|
||||
|
||||
|
||||
@@ -253,7 +253,7 @@ class HubService:
|
||||
settings = self._hub_user_settings or HubUserSettings()
|
||||
for v4_k, v in sorted(credentials.items()):
|
||||
v3_k = self.V4TOV3.get(v4_k, None)
|
||||
# If v3 key was there, we keep it
|
||||
# If v3 key was in the hub already, we keep it
|
||||
k = v3_k if v3_k in settings.features_keys else v4_k
|
||||
settings.features_keys[k] = v
|
||||
return settings
|
||||
|
||||
@@ -39,7 +39,7 @@ company financials, stock market holidays, corporate actions, and more.""",
|
||||
"MarketIndices": PolygonIndexHistoricalFetcher,
|
||||
"MarketSnapshots": PolygonMarketSnapshotsFetcher,
|
||||
},
|
||||
repr_name="Polygon",
|
||||
repr_name="Polygon.io",
|
||||
v3_credentials=["API_POLYGON_KEY"],
|
||||
instructions='Go to: https://polygon.io\n\n\n\nClick on, "Get your Free API Key".\n\n\n\nAfter signing up, the API Key is found at the bottom of the account dashboard page.\n\n', # noqa: E501 pylint: disable=line-too-long
|
||||
logo_url="https://polygon.io/_next/image?url=%2Flogo.svg&w=640&q=75",
|
||||
|
||||
Reference in New Issue
Block a user