googleapis / googleapis/python-aiplatform

Logging time series metrics to an experiment run with step=0 goes the wrong way

Đang mở
#2,133 3 bình luận 1 reaction 0 người được giao Xem trên GitHub
api: vertex-ai
Ngôn ngữ chính
Python
Star
905
Fork
465
Merge trung bình
1 ngày 13 giờ
Pull request đã merge (30 ngày)
44

Mô tả

#### Environment details

- OS type and version: Linux
- Python version: `all`
- pip version: `all`
- `google-cloud-aiplatform` version: `main`

#### Steps to reproduce

1. call `ExperimentRun.log_time_series_metrics()` with `step=0`.

The main issue here is the condition at [this line](https://github.com/googleapis/python-aiplatform/blob/main/google/cloud/aiplatform/metadata/experiment_run_resource.py#L955):

`if not step:`

Should be:

`if step is None:`

A caller that counts its steps starting at 0, would unnecessarily start a search for the latest time series step and that could trigger other issues, for example, hitting a limit on the size of the time series to read, which is not relevant here, but could be avoided if this condition was testing the right value.

#### Code example

```python
run = aiplatform.ExperimentRun(experiment=my_experiment, run_name=my_run_name)
run.log_time_series_metrics(my_metrics, step=0)
```

#### Stack trace
![Screen Shot 2023-04-25 at 12 31 47 PM](https://user-images.githubusercontent.com/1761609/234343653-f7cf5412-24f8-4a27-b43a-9706744ba1c2.png)

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.