googleapis / googleapis/google-cloud-python

Array contains operation is not supported

Aperta
#15,680 1 commento 0 reazioni 1 assegnatario Assegnata a @olavloite Vedi su GitHub
api: spanner
Lingua principale
Python
Stelle
5.4k
Fork
1.8k
Merge medio
3g 4h
PR unite (30g)
122

Descrizione

When creating an Array type column, the contains operation is not supported.

### To reproduce

```python
from sqlalchemy import ARRAY, String
from sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column

class Base(DeclarativeBase):
pass

class Sample(Base):
__tablename__ = "sample_table"
sample_field: Mapped[list[str]] = mapped_column(ARRAY(String(20)), nullable=False)

...

stmt = select(Sample).filter(Sample.sample_field.contains("test"))
```

### Error

```
NotImplementedError: ARRAY.contains() not implemented for the base ARRAY type; please use the dialect-specific ARRAY type
```

Going through the spanner dialect code, I could not find any array type I could import.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.