Module buildstock_query.schema.run_params

Expand source code
from typing import Optional, Union
from typing import Literal
from pydantic import BaseModel


class RunParams(BaseModel):
    workgroup: str
    db_name: str
    table_name: Union[str, tuple[str, Optional[str], Optional[str]]]
    buildstock_type: Literal['resstock', 'comstock'] = 'resstock'
    db_schema: Optional[str] = 'resstock_raw'
    sample_weight_override: Optional[Union[int, float]] = None
    region_name: str = 'us-west-2'
    execution_history: Optional[str] = None
    cache_folder: str = '.bsq_cache'
    athena_query_reuse: bool = True

    class Config:
        arbitrary_types_allowed = True
        smart_union = True


class BSQParams(RunParams):
    skip_reports: bool = False

    def get_run_params(self):
        return RunParams.parse_obj(self.dict(include=set(RunParams.__fields__.keys())))

Classes

class BSQParams (**data: Any)

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Expand source code
class BSQParams(RunParams):
    skip_reports: bool = False

    def get_run_params(self):
        return RunParams.parse_obj(self.dict(include=set(RunParams.__fields__.keys())))

Ancestors

  • RunParams
  • pydantic.main.BaseModel
  • pydantic.utils.Representation

Class variables

var skip_reports : bool

Methods

def get_run_params(self)
Expand source code
def get_run_params(self):
    return RunParams.parse_obj(self.dict(include=set(RunParams.__fields__.keys())))
class RunParams (**data: Any)

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Expand source code
class RunParams(BaseModel):
    workgroup: str
    db_name: str
    table_name: Union[str, tuple[str, Optional[str], Optional[str]]]
    buildstock_type: Literal['resstock', 'comstock'] = 'resstock'
    db_schema: Optional[str] = 'resstock_raw'
    sample_weight_override: Optional[Union[int, float]] = None
    region_name: str = 'us-west-2'
    execution_history: Optional[str] = None
    cache_folder: str = '.bsq_cache'
    athena_query_reuse: bool = True

    class Config:
        arbitrary_types_allowed = True
        smart_union = True

Ancestors

  • pydantic.main.BaseModel
  • pydantic.utils.Representation

Subclasses

Class variables

var Config
var athena_query_reuse : bool
var buildstock_type : Literal['resstock', 'comstock']
var cache_folder : str
var db_name : str
var db_schema : Optional[str]
var execution_history : Optional[str]
var region_name : str
var sample_weight_override : Union[int, float, ForwardRef(None)]
var table_name : Union[str, tuple[str, Optional[str], Optional[str]]]
var workgroup : str