Skip to content

Commit 9bf6bca

Browse files
add docs and defensive check for bool #105
1 parent 7311502 commit 9bf6bca

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

docs/pipestat_specification.md

+18
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,24 @@ log_file:
196196

197197
The highlighted results can be later retrieved by pipestat clients via `PipestatManager.highlighted_results` property, which simply returns a list of result identifiers.
198198

199+
## Add indexing to a Result (database backend only)
200+
If you would like to index a specific result, you can add `index: True` to the result:
201+
202+
```yaml
203+
title: An example Pipestat output schema
204+
description: A pipeline that uses pipestat to report sample and project level results.
205+
type: object
206+
properties:
207+
pipeline_name: "default_pipeline_name"
208+
samples:
209+
type: object
210+
properties:
211+
number_of_things:
212+
type: integer
213+
description: "Number of things"
214+
index: True
215+
```
216+
199217
# Status schema
200218

201219
Apart from results reporting pipestat provides a robust pipeline status management system, which can be used to report pipeline status from within the pipeline and monitor pipeline's status in other software. Status schema file defines the possible pipeline status identifiers and provides other metadata, like `description` or `color` for display purposes.

pipestat/backends/db_backend/db_parsed_schema.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,8 @@ def _make_field_definitions(self, data: Dict[str, Any], require_type: bool):
174174
)
175175
else:
176176
if "index" in subdata:
177-
result_indexed = subdata["index"]
177+
if isinstance(subdata["index"], bool):
178+
result_indexed = subdata["index"]
178179
defs[name] = (
179180
data_type,
180181
Field(

0 commit comments

Comments
 (0)