googleapis / googleapis/google-cloud-python

Array contains operation is not supported

Offen
#15,680 1 Kommentar 0 Reaktionen 1 zugewiesene Person Zugewiesen an @olavloite Auf GitHub ansehen
api: spanner
Vorherrschende Sprache
Python
Sterne
5.4k
Forks
1.8k
Ø Merge
3 T. 4 Std.
Gemergte PRs (30 T.)
122

Beschreibung

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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.