common-workflow-language / common-workflow-language/cwlprov-py
`Derivation.used_entity()` returns the generated entity instead of the used one
- Dominant language
- Python
- Stars
- 4
- Forks
- 3
- Avg merge
- 1h 35m
- Merged PRs (30d)
- 3
Description
`Derivation.used_entity()` in `cwlprov/prov.py` resolves the wrong identifier. The method reads `self.generated_entity_id` instead of `self.used_entity_id`, so it returns the same entity as `generated_entity()`.
https://github.com/common-workflow-language/cwlprov-py/blob/a318d73dd9/cwlprov/prov.py#L398-L400
```python
def used_entity(self) -> Union[Any, Entity, None]:
e_id = self.generated_entity_id
return e_id and self.provenance.entity(e_id)
```
Fix:
```python
def used_entity(self) -> Union[Any, Entity, None]:
e_id = self.used_entity_id
return e_id and self.provenance.entity(e_id)
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Read cwlprov/prov.py around lines 398-400 and compare used_entity_id with generated_entity_id. Update the lookup so used_entity() resolves the used entity, then run the project's relevant tests to confirm it no longer returns the generated entity.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 92/100