googleapis / googleapis/python-aiplatform

Featurestore entity read fails with AttributeError: _pb

Abierto
#3,247 0 comentarios 0 reacciones 0 asignados Ver en GitHub
api: vertex-ai
Lenguaje dominante
Python
Estrellas
905
Forks
465
Merge medio
1 d 13 h
PR fusionados (30 d)
44

Descripción

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

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.