googleapis / googleapis/python-aiplatform

BatchPredictionJob.completion_stats should be a method and not a property

Offen
#5,067 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
api: vertex-ai
Vorherrschende Sprache
Python
Sterne
905
Forks
465
Ø Merge
1 T. 13 Std.
Gemergte PRs (30 T.)
44

Beschreibung

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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.