ToArrow#
- class lsst.daf.butler.arrow_utils.ToArrow#
Bases:
ABCAn abstract interface for converting objects to an Arrow field of the appropriate type.
Attributes Summary
Arrow data type for the field this converter produces.
Arrow field this converter produces.
Name of the field.
Whether the field permits null or
Nonevalues.Methods Summary
append(value, column)Append an object's arrow representation to a
list.Return a new converter with the same name and type, but using dictionary encoding (to 32-bit integers) to compress duplicate values.
finish(column)Convert a list of values constructed via
appendinto an Arrow array.for_datetime(name[, nullable])Return a converter for
astropy.time.Time, stored as TAI nanoseconds since 1970-01-01.for_primitive(name, data_type, nullable)Return a converter for a primitive type already supported by Arrow.
for_region(name[, nullable])Return a converter for
lsst.sphgeom.Region.for_timespan(name[, nullable])Return a converter for
lsst.daf.butler.Timespan.for_uuid(name[, nullable])Return a converter for
uuid.UUID.Attributes Documentation
- data_type#
Arrow data type for the field this converter produces.
- field#
Arrow field this converter produces.
- name#
Name of the field.
- nullable#
Whether the field permits null or
Nonevalues.
Methods Documentation
- abstract append(value: Any, column: list[Any]) None#
Append an object’s arrow representation to a
list.Parameters#
- value
object Original value to be converted to a row in an Arrow column.
- column
list List of values to append to. The type of value to append is implementation-defined; the only requirement is that
finishbe able to handle thislistlater.
- value
- dictionary_encoded() ToArrow#
Return a new converter with the same name and type, but using dictionary encoding (to 32-bit integers) to compress duplicate values.
- abstract finish(column: list[Any]) Array#
Convert a list of values constructed via
appendinto an Arrow array.Parameters#
- column
list List of column values populated by
append.
- column
- static for_datetime(name: str, nullable: bool = True) ToArrow#
Return a converter for
astropy.time.Time, stored as TAI nanoseconds since 1970-01-01.Parameters#
- name
str Name of the schema field.
- nullable
bool Whether the field should permit null or
Nonevalues.
Returns#
- to_arrow
ToArrow Converter instance.
- name
- static for_primitive(name: str, data_type: DataType, nullable: bool) ToArrow#
Return a converter for a primitive type already supported by Arrow.
Parameters#
- name
str Name of the schema field.
- data_type
pyarrow.DataType Arrow data type object.
- nullable
bool Whether the field should permit null or
Nonevalues.
Returns#
- to_arrow
ToArrow Converter instance.
- name
- static for_region(name: str, nullable: bool = True) ToArrow#
Return a converter for
lsst.sphgeom.Region.Parameters#
- name
str Name of the schema field.
- nullable
bool Whether the field should permit null or
Nonevalues.
Returns#
- to_arrow
ToArrow Converter instance.
- name