Skip to content

Commit

Permalink
Dependencies: Migrate from crate[sqlalchemy] to sqlalchemy-cratedb
Browse files Browse the repository at this point in the history
The CrateDB SQLAlchemy dialect needs more love, so it was separated from
the DBAPI HTTP driver.
  • Loading branch information
amotl committed Jun 11, 2024
1 parent 0fb2976 commit 3ca0c1c
Show file tree
Hide file tree
Showing 18 changed files with 35 additions and 29 deletions.
3 changes: 2 additions & 1 deletion application/apache-superset/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
apache-superset
crate[sqlalchemy]==0.35.2
crate==1.0.0dev0
sqlalchemy-cratedb>=0.36,<1
2 changes: 1 addition & 1 deletion by-dataframe/dask/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ database table in a single operation. It can be used like this:
# DBURI = "crate://crate@localhost:4200/"

import sqlalchemy as sa
from crate.client.sqlalchemy.support import insert_bulk
from sqlalchemy_cratedb.support import insert_bulk

ddf.to_sql(
"testdrive",
Expand Down
5 changes: 2 additions & 3 deletions by-dataframe/dask/insert_dask.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
=====
::
pip install --upgrade click colorlog 'crate[sqlalchemy]' pandas
pip install --upgrade click colorlog pandas sqlalchemy-cratedb
Synopsis
========
Expand All @@ -21,11 +21,10 @@

import click
import dask.dataframe as dd
import sqlalchemy as sa
from crate.client.sqlalchemy.support import insert_bulk
from dask.diagnostics import ProgressBar
from pueblo.testing.pandas import makeTimeDataFrame
from pueblo.util.logging import setup_logging
from sqlalchemy_cratedb.support import insert_bulk

logger = logging.getLogger(__name__)

Expand Down
3 changes: 2 additions & 1 deletion by-dataframe/dask/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
click<9
colorlog<7
crate[sqlalchemy]
crate==1.0.0dev0
dask[dataframe]>=2024.4.1 # Python 3.11.9 breaks previous Dask
distributed>=2024.4.1 # Python 3.11.9 breaks previous Dask
pueblo>=0.0.7
sqlalchemy-cratedb>=0.36,<1
2 changes: 1 addition & 1 deletion by-dataframe/pandas/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ database table in a single operation. It can be used like this:
# DBURI = "crate://crate@localhost:4200/"

import sqlalchemy as sa
from crate.client.sqlalchemy.support import insert_bulk
from sqlalchemy_cratedb.support import insert_bulk

engine = sa.create_engine(DBURI, **kwargs)
df.to_sql(
Expand Down
4 changes: 2 additions & 2 deletions by-dataframe/pandas/insert_pandas.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
=====
::
pip install --upgrade click colorlog 'crate[sqlalchemy]' pandas
pip install --upgrade click colorlog pandas sqlalchemy-cratedb
Synopsis
Expand Down Expand Up @@ -50,9 +50,9 @@

import click
import sqlalchemy as sa
from crate.client.sqlalchemy.support import insert_bulk
from pueblo.testing.pandas import makeTimeDataFrame
from pueblo.util.logging import setup_logging
from sqlalchemy_cratedb.support import insert_bulk

logger = logging.getLogger(__name__)

Expand Down
3 changes: 2 additions & 1 deletion by-dataframe/pandas/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
click<9
colorlog<7
crate[sqlalchemy]
crate==1.0.0dev0
pandas<2.3
pueblo>=0.0.7
sqlalchemy-cratedb>=0.36,<1
2 changes: 1 addition & 1 deletion by-dataframe/polars/read_sqlalchemy.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Install the dependencies with:
```
$ pip install crate[sqlalchemy] polars
$ pip install polars sqlalchemy-cratedb
```
"""

Expand Down
2 changes: 1 addition & 1 deletion by-dataframe/polars/write_sqlalchemy.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Install the dependencies with to run this script:
`$ pip install polars pandas crate[sqlalchemy] pyarrow`
`$ pip install polars pandas pyarrow sqlalchemy-cratedb`
"""

import polars
Expand Down
2 changes: 1 addition & 1 deletion by-language/python-sqlalchemy/insert_efficient.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
=====
::
pip install --upgrade 'crate[sqlalchemy]'
pip install --upgrade sqlalchemy-cratedb
Synopsis
Expand Down
4 changes: 2 additions & 2 deletions topic/machine-learning/automl/requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Real.
cratedb-toolkit[io]
cratedb-toolkit[io]>=0.0.13,<0.1
pueblo[notebook,testing]>=0.0.7

# Development.
# cratedb-toolkit[io] @ git+https://github.com/crate-workbench/cratedb-toolkit.git@7f3a493
# cratedb-toolkit[io] @ git+https://github.com/crate-workbench/cratedb-toolkit.git@sqlalchemy-nt
# pueblo[notebook,testing] @ git+https://github.com/pyveci/pueblo.git@main

# Workstation.
Expand Down
8 changes: 5 additions & 3 deletions topic/machine-learning/automl/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# Real.
crate[sqlalchemy]
mlflow-cratedb==2.11.3
crate==1.0.0dev0
cratedb-toolkit>=0.0.13,<0.1
mlflow-cratedb==2.13.2
plotly<5.23
pycaret[models,parallel,test]==3.3.2
pydantic<2
python-dotenv<2
sqlalchemy==2.*
sqlalchemy-cratedb>=0.36,<1

# Development.
# mlflow-cratedb @ git+https://github.com/crate-workbench/mlflow-cratedb.git@main
# mlflow-cratedb @ git+https://github.com/crate-workbench/mlflow-cratedb.git@sqlalchemy-cratedb
5 changes: 3 additions & 2 deletions topic/machine-learning/llm-langchain/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Real.
crash
crate[sqlalchemy]==0.35.2
cratedb-toolkit==0.0.12
crate==1.0.0dev0
cratedb-toolkit>=0.0.13,<0.1
sqlalchemy-cratedb>=0.36,<1

# langchain[cratedb,openai]==0.0.354
# langchain-community==0.0.8
Expand Down
4 changes: 2 additions & 2 deletions topic/machine-learning/mlops-mlflow/requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Real.
cratedb-toolkit[io]
cratedb-toolkit[io]>=0.0.13,<0.1
pueblo[notebook,testing]>=0.0.7

# Development.
# cratedb-toolkit[io] @ git+https://github.com/crate-workbench/cratedb-toolkit.git@7f3a493
# cratedb-toolkit[io] @ git+https://github.com/crate-workbench/cratedb-toolkit.git@sqlalchemy-nt
# pueblo[notebook,testing] @ git+https://github.com/pyveci/pueblo.git@main

# Workstation.
Expand Down
4 changes: 2 additions & 2 deletions topic/machine-learning/mlops-mlflow/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Real.
dask>=2024.4.1 # Python 3.11.9 breaks previous Dask
distributed>=2024.4.1 # Python 3.11.9 breaks previous Dask
mlflow-cratedb==2.11.3
mlflow-cratedb==2.13.2
pydantic<3
salesforce-merlion>=2,<3
sqlalchemy==2.*

# Development.
# mlflow-cratedb @ git+https://github.com/crate-workbench/mlflow-cratedb.git@main
# mlflow-cratedb @ git+https://github.com/crate-workbench/mlflow-cratedb.git@sqlalchemy-cratedb
4 changes: 2 additions & 2 deletions topic/timeseries/dask-weather-data-import.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
},
"outputs": [],
"source": [
"!pip install dask 'pandas==2.0.0' 'crate[sqlalchemy]' 'cratedb-toolkit==0.0.10' 'pueblo>=0.0.7' kaggle"
"!pip install 'cratedb-toolkit' 'dask' 'kaggle' 'pandas==2.0.*' 'pueblo>=0.0.7' 'sqlalchemy-cratedb'"
]
},
{
Expand Down Expand Up @@ -531,7 +531,7 @@
"source": [
"import os\n",
"import sqlalchemy as sa\n",
"from crate.client.sqlalchemy.support import insert_bulk\n",
"from sqlalchemy_cratedb.support import insert_bulk\n",
"\n",
"# Define database address when using CrateDB Cloud.\n",
"# Please find these settings on your cluster overview page.\n",
Expand Down
5 changes: 3 additions & 2 deletions topic/timeseries/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
crate[sqlalchemy]==0.35.2
cratedb-toolkit[datasets]==0.0.12
crate==1.0.0dev0
cratedb-toolkit[datasets]==0.0.13
refinitiv-data<1.7
pandas<2
pycaret==3.3.2
pydantic<2
sqlalchemy<2
sqlalchemy-cratedb>=0.36,<1
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"metadata": {},
"outputs": [],
"source": [
"#!pip install 'crate[sqlalchemy]' 'pandas>=2' plotly kaleido"
"#!pip install kaleido 'pandas>=2' plotly sqlalchemy-cratedb"
]
},
{
Expand Down

0 comments on commit 3ca0c1c

Please sign in to comment.