googleapis / googleapis/python-aiplatform
BatchPredictionJob.completion_stats should be a method and not a property
- Lingua principale
- Python
- Stelle
- 905
- Fork
- 465
- Merge medio
- 1g 13h
- PR unite (30g)
- 44
Descrizione
The below bit of code I suspect incorrectly has the `@property` decorator. This is caching, so when you've created a BatchPredictionJob instance and called submit or create. the first time you call `.completion_stats` is the value that this instance will have forever. For obvious reasons this is extremely irritating and means you either have to keep creating fresh instances of BatchPredictionJob to get updated completion numbers. Or you have to copy the private code and call yourself, which isn't super great from a user maintenance PoV. It would be extremely useful to have the total number of input instances somewhere cached based on if its BQ or a GCS folder, in a similar way that this class provides an iterator to outputs. Then you can get a %age progress through the job rather than predictions output, again one has to write all this themselves on the outside of this class which is just kind of horrible aesthetics as a user.
https://github.com/googleapis/python-aiplatform/blob/96d2ecbb527cc52c71bbeddc2394eaf9c4f91e06/google/cloud/aiplatform/jobs.py#L385-L390
I'd happily raise an MR around these changes if they're seen as a good change that might get accepted. The change from being a property will be breaking, but I suspect *anyone* using this feature as is either has broken code that incorrectly states progress, or they are doing something horrible they would like to remove to work around it being a property.
Guida per i contributori
Apri la guida per i contributori
Valutazione
Questa issue non è ancora stata valutata.