dask-contrib / dask-sql

Distributed SQL Engine in Python using Dask
https://dask-sql.readthedocs.io/
MIT License
386 stars 71 forks source link

Rough implementation of DBAPI & sqlalchemy dialect #1303

Closed charlesbluca closed 3 weeks ago

charlesbluca commented 8 months ago

Definitely needs some work, but at the moment this enables us to query tables in a pre-populated dask_sql.Context through sqlalchemy with something like:

import dask.config

from dask_sql import Context
from dask.datasets import timeseries

from sqlalchemy import text

dask.config.set({"dataframe.convert-string": False})

c = Context()

c.create_table("df", timeseries())

with c.sqlalchemy_connection() as conn:
   result = conn.execute(text("select * from df where name = 'Alice'")).fetchall()

cc @randerzander @jdye64

codecov-commenter commented 8 months ago

Codecov Report

Attention: 160 lines in your changes are missing coverage. Please review.

Comparison is base (c274609) 83.12% compared to head (fb6e77d) 82.45%.

Files Patch % Lines
dask_sql/integrations/dbapi.py 0.00% 138 Missing :warning:
dask_sql/integrations/sqlalchemy.py 0.00% 17 Missing :warning:
dask_sql/context.py 16.66% 5 Missing :warning:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1303 +/- ## ========================================== - Coverage 83.12% 82.45% -0.68% ========================================== Files 77 79 +2 Lines 4261 4422 +161 Branches 795 814 +19 ========================================== + Hits 3542 3646 +104 - Misses 550 607 +57 Partials 169 169 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.