Column

pydantic model felis.datamodel.Column

Column model.

Parameters:

data (Any)

Fields:
Validators:
field autoincrement: bool | None = None

Whether the column is autoincremented.

Validated by:
field datatype: DataType [Required]

Datatype of the column.

Validated by:
field fits_tunit: str | None = None (alias 'fits:tunit')

FITS TUNIT of the column.

Validated by:
field ivoa_ucd: str | None = None (alias 'ivoa:ucd')

IVOA UCD of the column.

Validated by:
field ivoa_unit: str | None = None (alias 'ivoa:unit')

IVOA unit of the column.

Validated by:
field length: int | None = None

Length of the column.

Constraints:
  • gt = 0

Validated by:
field mysql_datatype: str | None = None (alias 'mysql:datatype')

MySQL datatype override on the column.

Validated by:
field nullable: bool = True

Whether the column can be NULL.

Validated by:
field postgresql_datatype: str | None = None (alias 'postgresql:datatype')

PostgreSQL datatype override on the column.

Validated by:
field precision: int | None = None

The numerical precision of the column.

For timestamps, this is the number of fractional digits retained in the seconds field.

Constraints:
  • ge = 0

Validated by:
field tap_column_index: int | None = None (alias 'tap:column_index')

TAP_SCHEMA column index of the column.

Validated by:
field tap_principal: int | None = 0 (alias 'tap:principal')

Whether this is a TAP_SCHEMA principal column.

Constraints:
  • ge = 0

  • le = 1

Validated by:
field tap_std: int | None = 0 (alias 'tap:std')

TAP_SCHEMA indication that this column is defined by an IVOA standard.

Constraints:
  • ge = 0

  • le = 1

Validated by:
field value: str | int | float | bool | None = None

Default value of the column.

Validated by:
field votable_arraysize: int | str | None = None (alias 'votable:arraysize')

VOTable arraysize of the column.

Validated by:
field votable_datatype: str | None = None (alias 'votable:datatype')

VOTable datatype of the column.

Validated by:
field votable_xtype: str | None = None (alias 'votable:xtype')

VOTable xtype (extended type) of the column.

Validated by:
validator check_ivoa_ucd  »  ivoa_ucd

Check that IVOA UCD values are valid.

Parameters:

ivoa_ucd (str) – IVOA UCD value to check.

Returns:

The IVOA UCD value if it is valid.

Return type:

str

validator check_length  »  all fields

Check that a valid length is provided for sized types.

Parameters:

values (dict[str, Any]) – Values of the column.

Returns:

The values of the column.

Return type:

dict [ str, Any ]

Raises:

ValueError – Raised if a length is not provided for a sized type.

validator check_precision  »  all fields

Check that precision is only valid for timestamp columns.

Returns:

The column being validated.

Return type:

Column

validator check_redundant_datatypes  »  all fields

Check for redundant datatypes on columns.

Parameters:

info (ValidationInfo) – Validation context used to determine if the check is enabled.

Returns:

The column being validated.

Return type:

Column

Raises:

ValueError – Raised if a datatype override is redundant.

validator check_units  »  all fields

Check that the fits:tunit or ivoa:unit field has valid units according to astropy. Only one may be provided.

Returns:

The column being validated.

Return type:

Column

Raises:

ValueError – Raised If both FITS and IVOA units are provided, or if the unit is invalid.

validator check_value  »  all fields

Check that the default value is valid.

Returns:

The column being validated.

Return type:

Column