4paradigm / 4paradigm/OpenMLDB

Support get_columns and parse protobuf object for Python SDK

Abierto
#3,180 1 comentario 0 reacciones 1 asignado Reclamado por @tobegit3hub Ver en GitHub
sdk
Lenguaje dominante
C++
Estrellas
1.7k
Forks
331
Merge medio
12 d 12 h
PR fusionados (30 d)
1

Descripción

Here is the code to test.

```
import sqlalchemy as db
from sqlalchemy import inspect

zk_cluster = "127.0.0.1:2181"
zk_path = "/openmldb"

engine = db.create_engine(f'openmldb:///db1?zk={zk_cluster}&zkPath={zk_path}')
connection = engine.connect()

insp = inspect(engine)
print(insp.get_table_names())

columns = insp.get_columns('employees')

for column in columns:
print(column)
```

We may add the code in `openmldb_dialect.py`.

```
def get_columns(self, connection, table_name, schema=None, **kw):
"""
columns_info = [
{
'name': 'name',
'type': sqlalchemy.String(),
'nullable': False,
'default': None,
'primary_key': False,
'autoincrement': False,
'comment': 'Unique identifier for the row'
}
]
return columns_info
"""
raise NotImplementedError()
```

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

The issue is about implementing get_columns and protobuf parsing in openmldb_dialect.py. Start by examining the existing dialect code to understand the connection and table structure. You'll need to fetch column metadata from OpenMLDB, likely via its API or SQL, and map types to SQLAlchemy types. Check if there are existing tests for the dialect to run your implementation against.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
python, sqlalchemy
Área
backend, databases
Tipo de issue
Nueva funcionalidad
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bien especificado
Aptitud para principiantes
65/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.