googleapis / googleapis/python-aiplatform

BatchPredictionJob.completion_stats should be a method and not a property

Ouverte
#5,067 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
api: vertex-ai
Langage dominant
Python
Étoiles
905
Forks
465
Merge moyen
1 j 13 h
PR mergées (30 j)
44

Description

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.

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez dans google/cloud/aiplatform/jobs.py autour des lignes 385-390 et examinez comment BatchPredictionJob.completion_stats est implémenté et utilisé. Comparez le comportement de la propriété avec la sémantique de méthode demandée par l'issue et examinez la gestion associée de la progression de batch prediction ; la solution terminée doit inclure un moyen clair et non obsolète de récupérer les statistiques d'achèvement sans modifier involontairement le comportement existant.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
python
Domaine
machine-learning
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.