4paradigm / 4paradigm/OpenMLDB

Support get_columns and parse protobuf object for Python SDK

Open
#3,180 1 comment 0 reactions 1 assignee Claimed by @tobegit3hub View on GitHub
sdk
Dominant language
C++
Stars
1.7k
Forks
331
Avg merge
12d 12h
Merged PRs (30d)
1

Description

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()
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.