googleapis / googleapis/python-aiplatform
BatchPredictionJob.completion_stats should be a method and not a property
- 主要言語
- Python
- スター
- 905
- フォーク
- 465
- 平均マージ
- 1日 13時間
- マージ済み PR(30日)
- 44
説明
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.
コントリビューションガイド
調査の方向性
google/cloud/aiplatform/jobs.py の 385〜390 行付近から始め、BatchPredictionJob.completion_stats がどのように実装され、使用されているかを調べます。property の動作を issue で要求されているメソッドのセマンティクスと比較し、関連する batch prediction の進行状況の処理を確認します。完了時には、既存の動作を気付かないうちに壊すことなく、完了統計を取得するための明確で古くならない方法が含まれている必要があります。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- machine-learning
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100