Dimension Config

pydantic model dsgrid.config.dimensions.DimensionModel[source]

Defines a non-time dimension

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

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

digraph "Entity Relationship Diagram created by erdantic" {
   graph [fontcolor=gray66,
      fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=9,
      nodesep=0.5,
      rankdir=LR,
      ranksep=1.5
   ];
   node [fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=14,
      label="\N",
      shape=plain
   ];
   edge [dir=both];
   "dsgrid.config.dimensions.DimensionModel"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>DimensionModel</b></td></tr><tr><td>name</td><td port="name">str</td></tr><tr><td>display_name</td><td port="display_name">str</td></tr><tr><td>dimension_query_name</td><td port="dimension_query_name">Optional[str]</td></tr><tr><td>dimension_type</td><td port="dimension_type">DimensionType</td></tr><tr><td>dimension_id</td><td port="dimension_id">Optional[str]</td></tr><tr><td>version</td><td port="version">Optional[str]</td></tr><tr><td>module</td><td port="module">str</td></tr><tr><td>class_name</td><td port="class_name">str</td></tr><tr><td>cls</td><td port="cls">Any</td></tr><tr><td>description</td><td port="description">str</td></tr><tr><td>id</td><td port="id">Optional[str]</td></tr><tr><td>key</td><td port="key">Optional[str]</td></tr><tr><td>rev</td><td port="rev">Optional[str]</td></tr><tr><td>filename</td><td port="filename">Optional[str]</td></tr><tr><td>file_hash</td><td port="file_hash">Optional[str]</td></tr><tr><td>records</td><td port="records">list</td></tr></table>>,
      tooltip="dsgrid.config.dimensions.DimensionModel&#xA;&#xA;Defines a non-time dimension&#xA;"];
}
Fields:
Validators:
field file_hash: str | None = None

Hash of the contents of the file

Validated by:
field filename: str | None = None (alias 'file')

Filename containing dimension records. Only assigned for user input and output purposes. The registry database stores records in the dimension JSON document.

Validated by:
field records: list = []

Dimension records in filename that get loaded at runtime

Validated by:
validator add_records  »  records[source]

Add records from the file.

validator check_file  »  filename[source]

Validate that dimension file exists and has no errors

validator compute_file_hash  »  file_hash[source]
serialize_cls(val, _)[source]

DateTime Dimension Config

pydantic model dsgrid.config.dimensions.DateTimeDimensionModel[source]

Defines a time dimension where timestamps translate to datetime objects.

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

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

digraph "Entity Relationship Diagram created by erdantic" {
   graph [fontcolor=gray66,
      fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=9,
      nodesep=0.5,
      rankdir=LR,
      ranksep=1.5
   ];
   node [fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=14,
      label="\N",
      shape=plain
   ];
   edge [dir=both];
   "dsgrid.config.dimensions.AlignedTime"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>AlignedTime</b></td></tr><tr><td>format_type</td><td port="format_type">Literal[DatetimeFormat.ALIGNED]</td></tr><tr><td>timezone</td><td port="timezone">TimeZone</td></tr></table>>,
      tooltip="dsgrid.config.dimensions.AlignedTime&#xA;&#xA;Data has absolute timestamps that are aligned with the same start and end&#xA;for \
each geography.&#xA;"];
   "dsgrid.config.dimensions.DateTimeDimensionModel"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>DateTimeDimensionModel</b></td></tr><tr><td>name</td><td port="name">str</td></tr><tr><td>display_name</td><td port="display_name">str</td></tr><tr><td>dimension_query_name</td><td port="dimension_query_name">Optional[str]</td></tr><tr><td>dimension_type</td><td port="dimension_type">DimensionType</td></tr><tr><td>dimension_id</td><td port="dimension_id">Optional[str]</td></tr><tr><td>version</td><td port="version">Optional[str]</td></tr><tr><td>module</td><td port="module">str</td></tr><tr><td>class_name</td><td port="class_name">str</td></tr><tr><td>cls</td><td port="cls">Any</td></tr><tr><td>description</td><td port="description">str</td></tr><tr><td>id</td><td port="id">Optional[str]</td></tr><tr><td>key</td><td port="key">Optional[str]</td></tr><tr><td>rev</td><td port="rev">Optional[str]</td></tr><tr><td>time_type</td><td port="time_type">TimeDimensionType</td></tr><tr><td>datetime_format</td><td port="datetime_format">Union[AlignedTime, LocalTimeAsStrings]</td></tr><tr><td>measurement_type</td><td port="measurement_type">MeasurementType</td></tr><tr><td>str_format</td><td port="str_format">str</td></tr><tr><td>frequency</td><td port="frequency">timedelta</td></tr><tr><td>ranges</td><td port="ranges">list[TimeRangeModel]</td></tr><tr><td>time_interval_type</td><td port="time_interval_type">TimeIntervalType</td></tr></table>>,
      tooltip="dsgrid.config.dimensions.DateTimeDimensionModel&#xA;&#xA;Defines a time dimension where timestamps translate to datetime objects.&#\
xA;"];
   "dsgrid.config.dimensions.DateTimeDimensionModel":datetime_format:e -> "dsgrid.config.dimensions.AlignedTime":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
   "dsgrid.config.dimensions.LocalTimeAsStrings"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>LocalTimeAsStrings</b></td></tr><tr><td>format_type</td><td port="format_type">Literal[DatetimeFormat.LOCAL_AS_STRINGS]</td></tr><tr><td>data_str_format</td><td port="data_str_format">str</td></tr></table>>,
      tooltip="dsgrid.config.dimensions.LocalTimeAsStrings&#xA;&#xA;Data has absolute timestamps formatted as strings with offsets from UTC.&#xA;\
They are aligned for each geography when adjusted for time zone but staggered&#xA;in an absolute time scale.&#xA;"];
   "dsgrid.config.dimensions.DateTimeDimensionModel":datetime_format:e -> "dsgrid.config.dimensions.LocalTimeAsStrings":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
   "dsgrid.config.dimensions.TimeRangeModel"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>TimeRangeModel</b></td></tr><tr><td>start</td><td port="start">str</td></tr><tr><td>end</td><td port="end">str</td></tr></table>>,
      tooltip="dsgrid.config.dimensions.TimeRangeModel&#xA;&#xA;Defines a continuous range of time.&#xA;"];
   "dsgrid.config.dimensions.DateTimeDimensionModel":ranges:e -> "dsgrid.config.dimensions.TimeRangeModel":_root:w   [arrowhead=crownone,
      arrowtail=nonenone];
}
Fields:
Validators:
field datetime_format: AlignedTime | LocalTimeAsStrings [Required]

Format of the datetime used to define the data format, alignment between geography, and time zone information.

Validated by:
field frequency: timedelta [Required]

Resolution of the timestamps

Validated by:
field measurement_type: MeasurementType = MeasurementType.TOTAL
The type of measurement represented by a value associated with a timestamp:

mean, min, max, measured, total

Validated by:
field ranges: list[TimeRangeModel] [Required]

Defines the continuous ranges of time in the data, inclusive of start and end time.

Validated by:
field str_format: str = '%Y-%m-%d %H:%M:%s'

Timestamp string format (for parsing the time ranges)

Validated by:
field time_interval_type: TimeIntervalType [Required]

The range of time that the value associated with a timestamp represents, e.g., period-beginning

Validated by:
validator check_frequency  »  all fields[source]
validator check_times  »  ranges[source]
validator handle_legacy_fields  »  all fields[source]
is_time_zone_required_in_geography()[source]

Returns True if the geography dimension records must contain a time_zone column.

Annual Time Dimension Config

pydantic model dsgrid.config.dimensions.AnnualTimeDimensionModel[source]

Defines an annual time dimension where timestamps are years.

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

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

digraph "Entity Relationship Diagram created by erdantic" {
   graph [fontcolor=gray66,
      fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=9,
      nodesep=0.5,
      rankdir=LR,
      ranksep=1.5
   ];
   node [fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=14,
      label="\N",
      shape=plain
   ];
   edge [dir=both];
   "dsgrid.config.dimensions.AnnualTimeDimensionModel"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>AnnualTimeDimensionModel</b></td></tr><tr><td>name</td><td port="name">str</td></tr><tr><td>display_name</td><td port="display_name">str</td></tr><tr><td>dimension_query_name</td><td port="dimension_query_name">Optional[str]</td></tr><tr><td>dimension_type</td><td port="dimension_type">DimensionType</td></tr><tr><td>dimension_id</td><td port="dimension_id">Optional[str]</td></tr><tr><td>version</td><td port="version">Optional[str]</td></tr><tr><td>module</td><td port="module">str</td></tr><tr><td>class_name</td><td port="class_name">str</td></tr><tr><td>cls</td><td port="cls">Any</td></tr><tr><td>description</td><td port="description">str</td></tr><tr><td>id</td><td port="id">Optional[str]</td></tr><tr><td>key</td><td port="key">Optional[str]</td></tr><tr><td>rev</td><td port="rev">Optional[str]</td></tr><tr><td>time_type</td><td port="time_type">TimeDimensionType</td></tr><tr><td>measurement_type</td><td port="measurement_type">MeasurementType</td></tr><tr><td>str_format</td><td port="str_format">str</td></tr><tr><td>ranges</td><td port="ranges">list[TimeRangeModel]</td></tr><tr><td>include_leap_day</td><td port="include_leap_day">bool</td></tr></table>>,
      tooltip="dsgrid.config.dimensions.AnnualTimeDimensionModel&#xA;&#xA;Defines an annual time dimension where timestamps are years.&#xA;"];
   "dsgrid.config.dimensions.TimeRangeModel"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>TimeRangeModel</b></td></tr><tr><td>start</td><td port="start">str</td></tr><tr><td>end</td><td port="end">str</td></tr></table>>,
      tooltip="dsgrid.config.dimensions.TimeRangeModel&#xA;&#xA;Defines a continuous range of time.&#xA;"];
   "dsgrid.config.dimensions.AnnualTimeDimensionModel":ranges:e -> "dsgrid.config.dimensions.TimeRangeModel":_root:w   [arrowhead=crownone,
      arrowtail=nonenone];
}
Fields:
Validators:
field include_leap_day: bool = False

Whether annual time includes leap day.

field measurement_type: MeasurementType = MeasurementType.TOTAL
The type of measurement represented by a value associated with a timestamp:

e.g., mean, total

Validated by:
field ranges: list[TimeRangeModel] [Required]

Defines the contiguous ranges of time in the data, inclusive of start and end time.

Validated by:
field str_format: str = '%Y'

Timestamp string format

field time_type: TimeDimensionType = TimeDimensionType.ANNUAL
validator check_measurement_type  »  measurement_type[source]
validator check_times  »  ranges[source]
is_time_zone_required_in_geography()[source]

Returns True if the geography dimension records must contain a time_zone column.

Representative Period Time Dimension Config

pydantic model dsgrid.config.dimensions.RepresentativePeriodTimeDimensionModel[source]

Defines a representative time dimension.

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

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

digraph "Entity Relationship Diagram created by erdantic" {
   graph [fontcolor=gray66,
      fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=9,
      nodesep=0.5,
      rankdir=LR,
      ranksep=1.5
   ];
   node [fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=14,
      label="\N",
      shape=plain
   ];
   edge [dir=both];
   "dsgrid.config.dimensions.MonthRangeModel"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>MonthRangeModel</b></td></tr><tr><td>start</td><td port="start">int</td></tr><tr><td>end</td><td port="end">int</td></tr></table>>,
      tooltip="dsgrid.config.dimensions.MonthRangeModel&#xA;&#xA;Defines a continuous range of time.&#xA;"];
   "dsgrid.config.dimensions.RepresentativePeriodTimeDimensionModel"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>RepresentativePeriodTimeDimensionModel</b></td></tr><tr><td>name</td><td port="name">str</td></tr><tr><td>display_name</td><td port="display_name">str</td></tr><tr><td>dimension_query_name</td><td port="dimension_query_name">Optional[str]</td></tr><tr><td>dimension_type</td><td port="dimension_type">DimensionType</td></tr><tr><td>dimension_id</td><td port="dimension_id">Optional[str]</td></tr><tr><td>version</td><td port="version">Optional[str]</td></tr><tr><td>module</td><td port="module">str</td></tr><tr><td>class_name</td><td port="class_name">str</td></tr><tr><td>cls</td><td port="cls">Any</td></tr><tr><td>description</td><td port="description">str</td></tr><tr><td>id</td><td port="id">Optional[str]</td></tr><tr><td>key</td><td port="key">Optional[str]</td></tr><tr><td>rev</td><td port="rev">Optional[str]</td></tr><tr><td>time_type</td><td port="time_type">TimeDimensionType</td></tr><tr><td>measurement_type</td><td port="measurement_type">MeasurementType</td></tr><tr><td>format</td><td port="format">RepresentativePeriodFormat</td></tr><tr><td>ranges</td><td port="ranges">list[MonthRangeModel]</td></tr><tr><td>time_interval_type</td><td port="time_interval_type">TimeIntervalType</td></tr></table>>,
      tooltip="dsgrid.config.dimensions.RepresentativePeriodTimeDimensionModel&#xA;&#xA;Defines a representative time dimension.&#xA;"];
   "dsgrid.config.dimensions.RepresentativePeriodTimeDimensionModel":ranges:e -> "dsgrid.config.dimensions.MonthRangeModel":_root:w   [arrowhead=crownone,
      arrowtail=nonenone];
}
Fields:
Validators:

field format: RepresentativePeriodFormat [Required]

Format of the timestamps in the load data

field measurement_type: MeasurementType = MeasurementType.TOTAL
The type of measurement represented by a value associated with a timestamp:

e.g., mean, total

field ranges: list[MonthRangeModel] [Required]

Defines the continuous ranges of time in the data, inclusive of start and end time.

field time_interval_type: TimeIntervalType [Required]

The range of time that the value associated with a timestamp represents

field time_type: TimeDimensionType = TimeDimensionType.REPRESENTATIVE_PERIOD
is_time_zone_required_in_geography()[source]

Returns True if the geography dimension records must contain a time_zone column.

No-op Time Dimension Config

pydantic model dsgrid.config.dimensions.NoOpTimeDimensionModel[source]

Defines a NoOp time dimension.

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

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

digraph "Entity Relationship Diagram created by erdantic" {
   graph [fontcolor=gray66,
      fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=9,
      nodesep=0.5,
      rankdir=LR,
      ranksep=1.5
   ];
   node [fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=14,
      label="\N",
      shape=plain
   ];
   edge [dir=both];
   "dsgrid.config.dimensions.NoOpTimeDimensionModel"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>NoOpTimeDimensionModel</b></td></tr><tr><td>name</td><td port="name">str</td></tr><tr><td>display_name</td><td port="display_name">str</td></tr><tr><td>dimension_query_name</td><td port="dimension_query_name">Optional[str]</td></tr><tr><td>dimension_type</td><td port="dimension_type">DimensionType</td></tr><tr><td>dimension_id</td><td port="dimension_id">Optional[str]</td></tr><tr><td>version</td><td port="version">Optional[str]</td></tr><tr><td>module</td><td port="module">str</td></tr><tr><td>class_name</td><td port="class_name">str</td></tr><tr><td>cls</td><td port="cls">Any</td></tr><tr><td>description</td><td port="description">str</td></tr><tr><td>id</td><td port="id">Optional[str]</td></tr><tr><td>key</td><td port="key">Optional[str]</td></tr><tr><td>rev</td><td port="rev">Optional[str]</td></tr><tr><td>time_type</td><td port="time_type">TimeDimensionType</td></tr></table>>,
      tooltip="dsgrid.config.dimensions.NoOpTimeDimensionModel&#xA;&#xA;Defines a NoOp time dimension.&#xA;"];
}
Fields:
Validators:

field time_type: TimeDimensionType = TimeDimensionType.NOOP
is_time_zone_required_in_geography()[source]

Returns True if the geography dimension records must contain a time_zone column.

pydantic model dsgrid.config.dimensions.TimeRangeModel[source]

Defines a continuous range of time.

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

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

digraph "Entity Relationship Diagram created by erdantic" {
   graph [fontcolor=gray66,
      fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=9,
      nodesep=0.5,
      rankdir=LR,
      ranksep=1.5
   ];
   node [fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=14,
      label="\N",
      shape=plain
   ];
   edge [dir=both];
   "dsgrid.config.dimensions.TimeRangeModel"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>TimeRangeModel</b></td></tr><tr><td>start</td><td port="start">str</td></tr><tr><td>end</td><td port="end">str</td></tr></table>>,
      tooltip="dsgrid.config.dimensions.TimeRangeModel&#xA;&#xA;Defines a continuous range of time.&#xA;"];
}
Fields:
field end: str [Required]

Last timestamp in the data (inclusive)

field start: str [Required]

First timestamp in the data

pydantic model dsgrid.config.dimensions.MonthRangeModel[source]

Defines a continuous range of time.

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

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

digraph "Entity Relationship Diagram created by erdantic" {
   graph [fontcolor=gray66,
      fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=9,
      nodesep=0.5,
      rankdir=LR,
      ranksep=1.5
   ];
   node [fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=14,
      label="\N",
      shape=plain
   ];
   edge [dir=both];
   "dsgrid.config.dimensions.MonthRangeModel"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>MonthRangeModel</b></td></tr><tr><td>start</td><td port="start">int</td></tr><tr><td>end</td><td port="end">int</td></tr></table>>,
      tooltip="dsgrid.config.dimensions.MonthRangeModel&#xA;&#xA;Defines a continuous range of time.&#xA;"];
}
Fields:
field end: int [Required]

Last month in the data (inclusive)

field start: int [Required]

First month in the data (January is 1, December is 12)

Dimension Reference

pydantic model dsgrid.config.dimensions.DimensionReferenceModel[source]

Reference to a dimension stored in the registry

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

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

digraph "Entity Relationship Diagram created by erdantic" {
   graph [fontcolor=gray66,
      fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=9,
      nodesep=0.5,
      rankdir=LR,
      ranksep=1.5
   ];
   node [fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=14,
      label="\N",
      shape=plain
   ];
   edge [dir=both];
   "dsgrid.config.dimensions.DimensionReferenceModel"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>DimensionReferenceModel</b></td></tr><tr><td>dimension_type</td><td port="dimension_type">DimensionType</td></tr><tr><td>dimension_id</td><td port="dimension_id">str</td></tr><tr><td>version</td><td port="version">str</td></tr></table>>,
      tooltip="dsgrid.config.dimensions.DimensionReferenceModel&#xA;&#xA;Reference to a dimension stored in the registry&#xA;"];
}
Fields:
field dimension_id: str [Required]

Unique ID of the dimension in the registry

field dimension_type: DimensionType [Required] (alias 'type')

Type of the dimension

field version: str [Required]

Version of the dimension

Dimensions Config

pydantic model dsgrid.config.dimensions_config.DimensionsConfigModel[source]

Represents multiple dimension models.

Used when registering multiple dimensions in one command.

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

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

digraph "Entity Relationship Diagram created by erdantic" {
   graph [fontcolor=gray66,
      fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=9,
      nodesep=0.5,
      rankdir=LR,
      ranksep=1.5
   ];
   node [fontname="Times New Roman,Times,Liberation Serif,serif",
      fontsize=14,
      label="\N",
      shape=plain
   ];
   edge [dir=both];
   "dsgrid.config.dimensions.AlignedTime"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>AlignedTime</b></td></tr><tr><td>format_type</td><td port="format_type">Literal[DatetimeFormat.ALIGNED]</td></tr><tr><td>timezone</td><td port="timezone">TimeZone</td></tr></table>>,
      tooltip="dsgrid.config.dimensions.AlignedTime&#xA;&#xA;Data has absolute timestamps that are aligned with the same start and end&#xA;for \
each geography.&#xA;"];
   "dsgrid.config.dimensions.AnnualTimeDimensionModel"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>AnnualTimeDimensionModel</b></td></tr><tr><td>name</td><td port="name">str</td></tr><tr><td>display_name</td><td port="display_name">str</td></tr><tr><td>dimension_query_name</td><td port="dimension_query_name">Optional[str]</td></tr><tr><td>dimension_type</td><td port="dimension_type">DimensionType</td></tr><tr><td>dimension_id</td><td port="dimension_id">Optional[str]</td></tr><tr><td>version</td><td port="version">Optional[str]</td></tr><tr><td>module</td><td port="module">str</td></tr><tr><td>class_name</td><td port="class_name">str</td></tr><tr><td>cls</td><td port="cls">Any</td></tr><tr><td>description</td><td port="description">str</td></tr><tr><td>id</td><td port="id">Optional[str]</td></tr><tr><td>key</td><td port="key">Optional[str]</td></tr><tr><td>rev</td><td port="rev">Optional[str]</td></tr><tr><td>time_type</td><td port="time_type">TimeDimensionType</td></tr><tr><td>measurement_type</td><td port="measurement_type">MeasurementType</td></tr><tr><td>str_format</td><td port="str_format">str</td></tr><tr><td>ranges</td><td port="ranges">list[TimeRangeModel]</td></tr><tr><td>include_leap_day</td><td port="include_leap_day">bool</td></tr></table>>,
      tooltip="dsgrid.config.dimensions.AnnualTimeDimensionModel&#xA;&#xA;Defines an annual time dimension where timestamps are years.&#xA;"];
   "dsgrid.config.dimensions.TimeRangeModel"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>TimeRangeModel</b></td></tr><tr><td>start</td><td port="start">str</td></tr><tr><td>end</td><td port="end">str</td></tr></table>>,
      tooltip="dsgrid.config.dimensions.TimeRangeModel&#xA;&#xA;Defines a continuous range of time.&#xA;"];
   "dsgrid.config.dimensions.AnnualTimeDimensionModel":ranges:e -> "dsgrid.config.dimensions.TimeRangeModel":_root:w   [arrowhead=crownone,
      arrowtail=nonenone];
   "dsgrid.config.dimensions.DateTimeDimensionModel"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>DateTimeDimensionModel</b></td></tr><tr><td>name</td><td port="name">str</td></tr><tr><td>display_name</td><td port="display_name">str</td></tr><tr><td>dimension_query_name</td><td port="dimension_query_name">Optional[str]</td></tr><tr><td>dimension_type</td><td port="dimension_type">DimensionType</td></tr><tr><td>dimension_id</td><td port="dimension_id">Optional[str]</td></tr><tr><td>version</td><td port="version">Optional[str]</td></tr><tr><td>module</td><td port="module">str</td></tr><tr><td>class_name</td><td port="class_name">str</td></tr><tr><td>cls</td><td port="cls">Any</td></tr><tr><td>description</td><td port="description">str</td></tr><tr><td>id</td><td port="id">Optional[str]</td></tr><tr><td>key</td><td port="key">Optional[str]</td></tr><tr><td>rev</td><td port="rev">Optional[str]</td></tr><tr><td>time_type</td><td port="time_type">TimeDimensionType</td></tr><tr><td>datetime_format</td><td port="datetime_format">Union[AlignedTime, LocalTimeAsStrings]</td></tr><tr><td>measurement_type</td><td port="measurement_type">MeasurementType</td></tr><tr><td>str_format</td><td port="str_format">str</td></tr><tr><td>frequency</td><td port="frequency">timedelta</td></tr><tr><td>ranges</td><td port="ranges">list[TimeRangeModel]</td></tr><tr><td>time_interval_type</td><td port="time_interval_type">TimeIntervalType</td></tr></table>>,
      tooltip="dsgrid.config.dimensions.DateTimeDimensionModel&#xA;&#xA;Defines a time dimension where timestamps translate to datetime objects.&#\
xA;"];
   "dsgrid.config.dimensions.DateTimeDimensionModel":datetime_format:e -> "dsgrid.config.dimensions.AlignedTime":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
   "dsgrid.config.dimensions.LocalTimeAsStrings"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>LocalTimeAsStrings</b></td></tr><tr><td>format_type</td><td port="format_type">Literal[DatetimeFormat.LOCAL_AS_STRINGS]</td></tr><tr><td>data_str_format</td><td port="data_str_format">str</td></tr></table>>,
      tooltip="dsgrid.config.dimensions.LocalTimeAsStrings&#xA;&#xA;Data has absolute timestamps formatted as strings with offsets from UTC.&#xA;\
They are aligned for each geography when adjusted for time zone but staggered&#xA;in an absolute time scale.&#xA;"];
   "dsgrid.config.dimensions.DateTimeDimensionModel":datetime_format:e -> "dsgrid.config.dimensions.LocalTimeAsStrings":_root:w   [arrowhead=noneteetee,
      arrowtail=nonenone];
   "dsgrid.config.dimensions.DateTimeDimensionModel":ranges:e -> "dsgrid.config.dimensions.TimeRangeModel":_root:w   [arrowhead=crownone,
      arrowtail=nonenone];
   "dsgrid.config.dimensions.DimensionModel"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>DimensionModel</b></td></tr><tr><td>name</td><td port="name">str</td></tr><tr><td>display_name</td><td port="display_name">str</td></tr><tr><td>dimension_query_name</td><td port="dimension_query_name">Optional[str]</td></tr><tr><td>dimension_type</td><td port="dimension_type">DimensionType</td></tr><tr><td>dimension_id</td><td port="dimension_id">Optional[str]</td></tr><tr><td>version</td><td port="version">Optional[str]</td></tr><tr><td>module</td><td port="module">str</td></tr><tr><td>class_name</td><td port="class_name">str</td></tr><tr><td>cls</td><td port="cls">Any</td></tr><tr><td>description</td><td port="description">str</td></tr><tr><td>id</td><td port="id">Optional[str]</td></tr><tr><td>key</td><td port="key">Optional[str]</td></tr><tr><td>rev</td><td port="rev">Optional[str]</td></tr><tr><td>filename</td><td port="filename">Optional[str]</td></tr><tr><td>file_hash</td><td port="file_hash">Optional[str]</td></tr><tr><td>records</td><td port="records">list</td></tr></table>>,
      tooltip="dsgrid.config.dimensions.DimensionModel&#xA;&#xA;Defines a non-time dimension&#xA;"];
   "dsgrid.config.dimensions.IndexRangeModel"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>IndexRangeModel</b></td></tr><tr><td>start</td><td port="start">int</td></tr><tr><td>end</td><td port="end">int</td></tr></table>>,
      tooltip="dsgrid.config.dimensions.IndexRangeModel&#xA;&#xA;Defines a continuous range of indices.&#xA;"];
   "dsgrid.config.dimensions.IndexTimeDimensionModel"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>IndexTimeDimensionModel</b></td></tr><tr><td>name</td><td port="name">str</td></tr><tr><td>display_name</td><td port="display_name">str</td></tr><tr><td>dimension_query_name</td><td port="dimension_query_name">Optional[str]</td></tr><tr><td>dimension_type</td><td port="dimension_type">DimensionType</td></tr><tr><td>dimension_id</td><td port="dimension_id">Optional[str]</td></tr><tr><td>version</td><td port="version">Optional[str]</td></tr><tr><td>module</td><td port="module">str</td></tr><tr><td>class_name</td><td port="class_name">str</td></tr><tr><td>cls</td><td port="cls">Any</td></tr><tr><td>description</td><td port="description">str</td></tr><tr><td>id</td><td port="id">Optional[str]</td></tr><tr><td>key</td><td port="key">Optional[str]</td></tr><tr><td>rev</td><td port="rev">Optional[str]</td></tr><tr><td>time_type</td><td port="time_type">TimeDimensionType</td></tr><tr><td>measurement_type</td><td port="measurement_type">MeasurementType</td></tr><tr><td>ranges</td><td port="ranges">list[IndexRangeModel]</td></tr><tr><td>frequency</td><td port="frequency">timedelta</td></tr><tr><td>starting_timestamps</td><td port="starting_timestamps">list[str]</td></tr><tr><td>str_format</td><td port="str_format">str</td></tr><tr><td>time_interval_type</td><td port="time_interval_type">TimeIntervalType</td></tr></table>>,
      tooltip="dsgrid.config.dimensions.IndexTimeDimensionModel&#xA;&#xA;Defines a time dimension where timestamps are indices.&#xA;"];
   "dsgrid.config.dimensions.IndexTimeDimensionModel":ranges:e -> "dsgrid.config.dimensions.IndexRangeModel":_root:w   [arrowhead=crownone,
      arrowtail=nonenone];
   "dsgrid.config.dimensions.MonthRangeModel"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>MonthRangeModel</b></td></tr><tr><td>start</td><td port="start">int</td></tr><tr><td>end</td><td port="end">int</td></tr></table>>,
      tooltip="dsgrid.config.dimensions.MonthRangeModel&#xA;&#xA;Defines a continuous range of time.&#xA;"];
   "dsgrid.config.dimensions.NoOpTimeDimensionModel"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>NoOpTimeDimensionModel</b></td></tr><tr><td>name</td><td port="name">str</td></tr><tr><td>display_name</td><td port="display_name">str</td></tr><tr><td>dimension_query_name</td><td port="dimension_query_name">Optional[str]</td></tr><tr><td>dimension_type</td><td port="dimension_type">DimensionType</td></tr><tr><td>dimension_id</td><td port="dimension_id">Optional[str]</td></tr><tr><td>version</td><td port="version">Optional[str]</td></tr><tr><td>module</td><td port="module">str</td></tr><tr><td>class_name</td><td port="class_name">str</td></tr><tr><td>cls</td><td port="cls">Any</td></tr><tr><td>description</td><td port="description">str</td></tr><tr><td>id</td><td port="id">Optional[str]</td></tr><tr><td>key</td><td port="key">Optional[str]</td></tr><tr><td>rev</td><td port="rev">Optional[str]</td></tr><tr><td>time_type</td><td port="time_type">TimeDimensionType</td></tr></table>>,
      tooltip="dsgrid.config.dimensions.NoOpTimeDimensionModel&#xA;&#xA;Defines a NoOp time dimension.&#xA;"];
   "dsgrid.config.dimensions.RepresentativePeriodTimeDimensionModel"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>RepresentativePeriodTimeDimensionModel</b></td></tr><tr><td>name</td><td port="name">str</td></tr><tr><td>display_name</td><td port="display_name">str</td></tr><tr><td>dimension_query_name</td><td port="dimension_query_name">Optional[str]</td></tr><tr><td>dimension_type</td><td port="dimension_type">DimensionType</td></tr><tr><td>dimension_id</td><td port="dimension_id">Optional[str]</td></tr><tr><td>version</td><td port="version">Optional[str]</td></tr><tr><td>module</td><td port="module">str</td></tr><tr><td>class_name</td><td port="class_name">str</td></tr><tr><td>cls</td><td port="cls">Any</td></tr><tr><td>description</td><td port="description">str</td></tr><tr><td>id</td><td port="id">Optional[str]</td></tr><tr><td>key</td><td port="key">Optional[str]</td></tr><tr><td>rev</td><td port="rev">Optional[str]</td></tr><tr><td>time_type</td><td port="time_type">TimeDimensionType</td></tr><tr><td>measurement_type</td><td port="measurement_type">MeasurementType</td></tr><tr><td>format</td><td port="format">RepresentativePeriodFormat</td></tr><tr><td>ranges</td><td port="ranges">list[MonthRangeModel]</td></tr><tr><td>time_interval_type</td><td port="time_interval_type">TimeIntervalType</td></tr></table>>,
      tooltip="dsgrid.config.dimensions.RepresentativePeriodTimeDimensionModel&#xA;&#xA;Defines a representative time dimension.&#xA;"];
   "dsgrid.config.dimensions.RepresentativePeriodTimeDimensionModel":ranges:e -> "dsgrid.config.dimensions.MonthRangeModel":_root:w   [arrowhead=crownone,
      arrowtail=nonenone];
   "dsgrid.config.dimensions_config.DimensionsConfigModel"   [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>DimensionsConfigModel</b></td></tr><tr><td>dimensions</td><td port="dimensions">list[Union[DimensionModel, DateTimeDimensionModel, AnnualTimeDimensionModel, RepresentativePeriodTimeDimensionModel, IndexTimeDimensionModel, NoOpTimeDimensionModel]]</td></tr></table>>,
      tooltip="dsgrid.config.dimensions_config.DimensionsConfigModel&#xA;&#xA;Represents multiple dimension models.&#xA;&#xA;Used when registering \
multiple dimensions in one command.&#xA;"];
   "dsgrid.config.dimensions_config.DimensionsConfigModel":dimensions:e -> "dsgrid.config.dimensions.AnnualTimeDimensionModel":_root:w   [arrowhead=crownone,
      arrowtail=nonenone];
   "dsgrid.config.dimensions_config.DimensionsConfigModel":dimensions:e -> "dsgrid.config.dimensions.DateTimeDimensionModel":_root:w   [arrowhead=crownone,
      arrowtail=nonenone];
   "dsgrid.config.dimensions_config.DimensionsConfigModel":dimensions:e -> "dsgrid.config.dimensions.DimensionModel":_root:w   [arrowhead=crownone,
      arrowtail=nonenone];
   "dsgrid.config.dimensions_config.DimensionsConfigModel":dimensions:e -> "dsgrid.config.dimensions.IndexTimeDimensionModel":_root:w   [arrowhead=crownone,
      arrowtail=nonenone];
   "dsgrid.config.dimensions_config.DimensionsConfigModel":dimensions:e -> "dsgrid.config.dimensions.NoOpTimeDimensionModel":_root:w   [arrowhead=crownone,
      arrowtail=nonenone];
   "dsgrid.config.dimensions_config.DimensionsConfigModel":dimensions:e -> "dsgrid.config.dimensions.RepresentativePeriodTimeDimensionModel":_root:w   [arrowhead=crownone,
      arrowtail=nonenone];
}
Fields:
Validators:
field dimensions: Annotated[list[DimensionModel | DateTimeDimensionModel | AnnualTimeDimensionModel | RepresentativePeriodTimeDimensionModel | IndexTimeDimensionModel | NoOpTimeDimensionModel], BeforeValidator(func=handle_dimension_union, json_schema_input_type=PydanticUndefined)] [Required]

Dimensions for submission to the dimension registry

Constraints:
  • func = <function handle_dimension_union at 0x7fdfb5e6f380>

  • json_schema_input_type = PydanticUndefined

Validated by:
validator check_files  »  dimensions[source]

Validate dimension files are unique across all dimensions

validator check_names  »  dimensions[source]

Validate dimension names are unique across all dimensions.