HashColumnSpec¶
- final class lsst.daf.butler.column_spec.HashColumnSpec(*, name: str, doc: str = '', type: Literal['hash'] = 'hash', nullable: bool = True, nbytes: int)¶
Bases:
_BaseColumnSpec
Description of a hash digest.
Attributes Summary
A dictionary of computed field names and their corresponding
ComputedFieldInfo
objects.Configuration for the model, should be a dictionary conforming to [
ConfigDict
][pydantic.config.ConfigDict].Metadata about the fields defined on the model, mapping of field names to [
FieldInfo
][pydantic.fields.FieldInfo].Methods Summary
to_arrow
()Return an object that converts values of this column to a column in an Arrow table.
to_sql_spec
([name_shrinker])Convert this specification to a SQL-specific one.
Attributes Documentation
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding
ComputedFieldInfo
objects.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [
ConfigDict
][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'doc': FieldInfo(annotation=str, required=False, default='', description='Documentation for the column.'), 'name': FieldInfo(annotation=str, required=True, description='Name of the column.'), 'nbytes': FieldInfo(annotation=int, required=True), 'nullable': FieldInfo(annotation=bool, required=False, default=True, description='Whether the column may be ``NULL``.'), 'type': FieldInfo(annotation=Literal['hash'], required=False, default='hash')}¶
Metadata about the fields defined on the model, mapping of field names to [
FieldInfo
][pydantic.fields.FieldInfo].This replaces
Model.__fields__
from Pydantic V1.
Methods Documentation
- to_arrow() ToArrow ¶
Return an object that converts values of this column to a column in an Arrow table.
- Returns:
- converter
arrow_utils.ToArrow
A converter object with schema information in Arrow form.
- converter
- to_sql_spec(name_shrinker: NameShrinker | None = None, **kwargs: Any) ddl.FieldSpec ¶
Convert this specification to a SQL-specific one.
- Parameters:
- name_shrinker
NameShrinker
, optional Object that should be used to shrink the field name to ensure it fits within database-specific limits.
- **kwargs
Forwarded to
ddl.FieldSpec
.
- name_shrinker
- Returns:
- sql_spec
ddl.FieldSpec
A SQL-specific version of this specification.
- sql_spec