Skip to content

Commit

Permalink
More docs.
Browse files Browse the repository at this point in the history
DO NOT MERGE (squash instead).
  • Loading branch information
TallJimbo committed Mar 14, 2024
1 parent 38e83e8 commit ab12144
Show file tree
Hide file tree
Showing 5 changed files with 794 additions and 192 deletions.
29 changes: 24 additions & 5 deletions python/lsst/daf/butler/direct_query_driver/_convert_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,31 @@ def convert_dimension_record_results(
next_key: PageKey | None,
name_shrinker: NameShrinker,
) -> DimensionRecordResultPage:
"""Convert a raw SQL result iterable into a page of `DimensionRecord`
query results.
Parameters
----------
raw_rows : `~collections.abc.Iterable` [ `sqlalchemy.Row` ]
Iterable of SQLAlchemy rows, with `Postprocessing` filters already
applied.
spec : `DimensionRecordResultSpec`
Specification for result objects.
next_key : `PageKey` or `None`
Key for the next page to add into the returned page object.
name_shrinker : `NameShrinker`
Object used to ensure dataset type field names fit inside the database
engine's identifier size limit. Unnecessary for dimension fields,
which are restricted to fit in the identifier size limit when a
universe is initialized.
Returns
-------
result_page : `DimensionRecordResultPage`
Page object that holds a `DimensionRecord` container.
"""
record_set = DimensionRecordSet(spec.element)

Check warning on line 74 in python/lsst/daf/butler/direct_query_driver/_convert_results.py

View check run for this annotation

Codecov / codecov/patch

python/lsst/daf/butler/direct_query_driver/_convert_results.py#L74

Added line #L74 was not covered by tests
columns = spec.get_result_columns()
column_mapping = [
(field, name_shrinker.shrink(columns.get_qualified_name(spec.element.name, field)))
for field in spec.element.schema.names
]
column_mapping = [(field, field) for field in spec.element.schema.names]
record_cls = spec.element.RecordClass

Check warning on line 76 in python/lsst/daf/butler/direct_query_driver/_convert_results.py

View check run for this annotation

Codecov / codecov/patch

python/lsst/daf/butler/direct_query_driver/_convert_results.py#L76

Added line #L76 was not covered by tests
if not spec.element.temporal:
for raw_row in raw_rows:
Expand Down
Loading

0 comments on commit ab12144

Please sign in to comment.