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 51168c6
Show file tree
Hide file tree
Showing 16 changed files with 28 additions and 34 deletions.
2 changes: 1 addition & 1 deletion application/apache-superset/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
apache-superset
crate[sqlalchemy]==0.35.2
sqlalchemy-cratedb>=0.36.1,<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
2 changes: 1 addition & 1 deletion by-dataframe/dask/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
click<9
colorlog<7
crate[sqlalchemy]
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,<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
4 changes: 2 additions & 2 deletions by-dataframe/pandas/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
click<9
colorlog<7
crate[sqlalchemy]
pandas<2.3
pandas==2.2.*
pueblo>=0.0.7
sqlalchemy-cratedb>=0.36.1,<1
6 changes: 2 additions & 4 deletions by-dataframe/polars/read_sqlalchemy.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
"""
Install the dependencies with:
Install the dependencies to run this program::
```
$ pip install crate[sqlalchemy] polars
```
pip install --upgrade polars sqlalchemy-cratedb
"""

import polars
Expand Down
4 changes: 2 additions & 2 deletions by-dataframe/polars/write_sqlalchemy.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"""
Import a parquet file into CrateDB using polars + sqlalchemy
Install the dependencies with to run this script:
Install the dependencies to run this program::
`$ pip install polars pandas crate[sqlalchemy] pyarrow`
pip install --upgrade pandas polars 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
5 changes: 3 additions & 2 deletions topic/machine-learning/automl/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# Real.
crate[sqlalchemy]
mlflow-cratedb==2.11.3
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,<1

# Development.
# mlflow-cratedb @ git+https://github.com/crate-workbench/mlflow-cratedb.git@main
8 changes: 2 additions & 6 deletions topic/machine-learning/llm-langchain/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
# Real.
crash
crate[sqlalchemy]==0.35.2
cratedb-toolkit==0.0.12

# langchain[cratedb,openai]==0.0.354
# langchain-community==0.0.8

cratedb-toolkit>=0.0.13,<0.1
google-cloud-aiplatform<2
langchain-google-vertexai<2
langchain-openai<0.2
Expand All @@ -17,6 +12,7 @@ python-dotenv<2
requests<3
requests-cache<2
sqlalchemy==2.*
sqlalchemy-cratedb>=0.36.1,<1
unstructured<0.15

# Development.
Expand Down
2 changes: 1 addition & 1 deletion topic/machine-learning/mlops-mlflow/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# 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.*
Expand Down
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 --upgrade '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
8 changes: 4 additions & 4 deletions topic/timeseries/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
crate[sqlalchemy]==0.35.2
cratedb-toolkit[datasets]==0.0.12
cratedb-toolkit[datasets]==0.0.13
refinitiv-data<1.7
pandas<2
pandas==1.*
pycaret==3.3.2
pydantic<2
sqlalchemy<2
sqlalchemy==1.*
sqlalchemy-cratedb>=0.36.1,<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 --upgrade kaleido 'pandas>=2' plotly sqlalchemy-cratedb"
]
},
{
Expand Down

0 comments on commit 51168c6

Please sign in to comment.