bayesline.api.equity.RiskDatasetSettings

bayesline.api.equity.RiskDatasetSettings#

pydantic model bayesline.api.equity.RiskDatasetSettings#

Base settings for a risk dataset.

Two concrete variants subclass this: DerivedRiskDatasetSettings (built on top of a reference dataset) and RootRiskDatasetSettings (assembled directly from upload sources). Subclasses override kind with a Literal for polymorphic deserialization via the discriminated union AnyRiskDatasetSettings.

The base is registered alongside both variants so the registry’s umbrella view registry[RiskDatasetSettings] reads/lists every variant at once (the reader is subclass-aware), while registry[RootRiskDatasetSettings] / registry[DerivedRiskDatasetSettings] scope to a single variant. Writes must route through the concrete-typed registry so the matching validator — and its dataset-source menu — runs.

Show JSON schema
{
   "title": "RiskDatasetSettings",
   "description": "Base settings for a risk dataset.\n\nTwo concrete variants subclass this: ``DerivedRiskDatasetSettings`` (built on\ntop of a reference dataset) and ``RootRiskDatasetSettings`` (assembled directly\nfrom upload sources). Subclasses override ``kind`` with a ``Literal`` for\npolymorphic deserialization via the discriminated union ``AnyRiskDatasetSettings``.\n\nThe base is registered alongside both variants so the registry's umbrella view\n``registry[RiskDatasetSettings]`` reads/lists every variant at once (the reader\nis subclass-aware), while ``registry[RootRiskDatasetSettings]`` /\n``registry[DerivedRiskDatasetSettings]`` scope to a single variant. Writes must\nroute through the concrete-typed registry so the matching validator \u2014 and its\ndataset-source menu \u2014 runs.",
   "type": "object",
   "properties": {
      "kind": {
         "description": "Discriminator field for the risk dataset settings union (root vs derived). Subclasses override with a ``Literal``.",
         "title": "Kind",
         "type": "string"
      }
   },
   "additionalProperties": false,
   "required": [
      "kind"
   ]
}

Config:
  • frozen: bool = True

  • extra: str = forbid

Fields:
  • kind (str)

Validators:

field kind: str [Required]#

Discriminator field for the risk dataset settings union (root vs derived). Subclasses override with a Literal.

Validated by:
  • _strip_unknown_on_load

property menu_type: type[RiskDatasetSettingsMenu]#

Get the menu type for this settings object.

Returns#

type[M]

The menu type for this settings object.