googleapis / googleapis/python-aiplatform

Featurestore entity read fails with AttributeError: _pb

Ouverte
#3,247 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

#### 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!

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

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