googleapis / googleapis/python-aiplatform

Featurestore entity read fails with AttributeError: _pb

Đang mở
#3,247 0 bình luận 0 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: `OSX 14.2.1`
- Python version: `Python 3.11.7`
- pip version: `pip 23.3.2`
- `google-cloud-aiplatform` version: ` 1.40.0`

#### Code example

```python
fs = aiplatform.Featurestore(
"projects/my-project"
"/locations/europe-west1"
"/featurestores/my-feature-store"
)
entity = fs.get_entity_type(entity_type_id="my-entity")
entity.read(entity_ids="1")
```

#### Stack trace
```
AttributeError Traceback (most recent call last)
Cell In[20], [line 1](vscode-notebook-cell:?execution_count=20&line=1)
----> [1](vscode-notebook-cell:?execution_count=20&line=1) entity.read(entity_ids="1")

File [/opt/homebrew/anaconda3/envs/vertex/lib/python3.11/site-packages/google/cloud/aiplatform/featurestore/_entity_type.py:1496](https://file+.vscode-resource.vscode-cdn.net/opt/homebrew/anaconda3/envs/vertex/lib/python3.11/site-packages/google/cloud/aiplatform/featurestore/_entity_type.py:1496), in _EntityType.read(self, entity_ids, feature_ids, request_metadata, read_request_timeout)
[1487](https://file+.vscode-resource.vscode-cdn.net/opt/homebrew/anaconda3/envs/vertex/lib/python3.11/site-packages/google/cloud/aiplatform/featurestore/_entity_type.py:1487) entity_views = [
[1488](https://file+.vscode-resource.vscode-cdn.net/opt/homebrew/anaconda3/envs/vertex/lib/python3.11/site-packages/google/cloud/aiplatform/featurestore/_entity_type.py:1488) response.entity_view
[1489](https://file+.vscode-resource.vscode-cdn.net/opt/homebrew/anaconda3/envs/vertex/lib/python3.11/site-packages/google/cloud/aiplatform/featurestore/_entity_type.py:1489) for response in streaming_read_feature_values_responses[1:]
[1490](https://file+.vscode-resource.vscode-cdn.net/opt/homebrew/anaconda3/envs/vertex/lib/python3.11/site-packages/google/cloud/aiplatform/featurestore/_entity_type.py:1490) ]
[1492](https://file+.vscode-resource.vscode-cdn.net/opt/homebrew/anaconda3/envs/vertex/lib/python3.11/site-packages/google/cloud/aiplatform/featurestore/_entity_type.py:1492) feature_ids = [
[1493](https://file+.vscode-resource.vscode-cdn.net/opt/homebrew/anaconda3/envs/vertex/lib/python3.11/site-packages/google/cloud/aiplatform/featurestore/_entity_type.py:1493) feature_descriptor.id for feature_descriptor in header.feature_descriptors
[1494](https://file+.vscode-resource.vscode-cdn.net/opt/homebrew/anaconda3/envs/vertex/lib/python3.11/site-packages/google/cloud/aiplatform/featurestore/_entity_type.py:1494) ]
-> [1496](https://file+.vscode-resource.vscode-cdn.net/opt/homebrew/anaconda3/envs/vertex/lib/python3.11/site-packages/google/cloud/aiplatform/featurestore/_entity_type.py:1496) return self._construct_dataframe(
[1497](https://file+.vscode-resource.vscode-cdn.net/opt/homebrew/anaconda3/envs/vertex/lib/python3.11/site-packages/google/cloud/aiplatform/featurestore/_entity_type.py:1497) feature_ids=feature_ids,
[1498](https://file+.vscode-resource.vscode-cdn.net/opt/homebrew/anaconda3/envs/vertex/lib/python3.11/site-packages/google/cloud/aiplatform/featurestore/_entity_type.py:1498) entity_views=entity_views,
[1499](https://file+.vscode-resource.vscode-cdn.net/opt/homebrew/anaconda3/envs/vertex/lib/python3.11/site-packages/google/cloud/aiplatform/featurestore/_entity_type.py:1499) )

File [/opt/homebrew/anaconda3/envs/vertex/lib/python3.11/site-packages/google/cloud/aiplatform/featurestore/_entity_type.py:1541](https://file+.vscode-resource.vscode-cdn.net/opt/homebrew/anaconda3/envs/vertex/lib/python3.11/site-packages/google/cloud/aiplatform/featurestore/_entity_type.py:1541), in _EntityType._construct_dataframe(feature_ids, entity_views)
[1539](https://file+.vscode-resource.vscode-cdn.net/opt/homebrew/anaconda3/envs/vertex/lib/python3.11/site-packages/google/cloud/aiplatform/featurestore/_entity_type.py:1539) entity_data = {"entity_id": entity_view.entity_id}
[1540](https://file+.vscode-resource.vscode-cdn.net/opt/homebrew/anaconda3/envs/vertex/lib/python3.11/site-packages/google/cloud/aiplatform/featurestore/_entity_type.py:1540) for feature_id, feature_data in zip(feature_ids, entity_view.data):
-> [1541](https://file+.vscode-resource.vscode-cdn.net/opt/homebrew/anaconda3/envs/vertex/lib/python3.11/site-packages/google/cloud/aiplatform/featurestore/_entity_type.py:1541) if feature_data._pb.HasField("value"):
[1542](https://file+.vscode-resource.vscode-cdn.net/opt/homebrew/anaconda3/envs/vertex/lib/python3.11/site-packages/google/cloud/aiplatform/featurestore/_entity_type.py:1542) value_type = feature_data.value._pb.WhichOneof("value")
[1543](https://file+.vscode-resource.vscode-cdn.net/opt/homebrew/anaconda3/envs/vertex/lib/python3.11/site-packages/google/cloud/aiplatform/featurestore/_entity_type.py:1543) feature_value = getattr(feature_data.value, value_type)

AttributeError: _pb
```

Making sure to follow these steps will guarantee the quickest resolution possible.

Thanks!

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.