Skip to content

Commit

Permalink
Remove derived Document.etl_output_url attribute
Browse files Browse the repository at this point in the history
The `etloutput` module will handle this instead.
  • Loading branch information
mawelborn committed Nov 21, 2024
1 parent 39e62a0 commit 8204509
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 6 deletions.
5 changes: 0 additions & 5 deletions indico_toolkit/results/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ class Document:
id: int
name: str
etl_output_url: str
full_text_url: str

# Auto review changes must reproduce all model sections that were present in the
# original result file. This may not be possible from the predictions alone--if a
Expand All @@ -26,14 +25,12 @@ def from_v1_dict(result: object) -> "Document":
document_results = get(result, dict, "results", "document", "results")
model_names = frozenset(document_results.keys())
etl_output_url = get(result, str, "etl_output")
full_text_url = etl_output_url.replace("etl_output.json", "full_text.txt")

return Document(
# v1 result files don't include document IDs or filenames.
id=None, # type: ignore[arg-type]
name=None, # type: ignore[arg-type]
etl_output_url=etl_output_url,
full_text_url=full_text_url,
_model_sections=model_names,
)

Expand All @@ -45,12 +42,10 @@ def from_v3_dict(document: object) -> "Document":
model_results = get(document, dict, "model_results", "ORIGINAL")
model_ids = frozenset(model_results.keys())
etl_output_url = get(document, str, "etl_output")
full_text_url = etl_output_url.replace("etl_output.json", "full_text.txt")

return Document(
id=get(document, int, "submissionfile_id"),
name=get(document, str, "input_filename"),
etl_output_url=etl_output_url,
full_text_url=full_text_url,
_model_sections=model_ids,
)
1 change: 0 additions & 1 deletion tests/results/test_predictionlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ def document() -> Document:
id=2922,
name="1040_filled.tiff",
etl_output_url="indico-file:///storage/submission/2922/etl_output.json",
full_text_url="indico-file:///storage/submission/2922/full_text.txt",
_model_sections=frozenset({"124", "123", "122", "121"}),
)

Expand Down

0 comments on commit 8204509

Please sign in to comment.