Skip to content

Commit

Permalink
Rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
betodealmeida committed Sep 24, 2024
1 parent 38642c8 commit 811de6d
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/python-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
pip install -r requirements/test.txt
- name: Start the Postgres service
run: |
docker-compose -f postgres/docker-compose.yml up --build -d
docker compose -f postgres/docker-compose.yml up --build -d
- name: Wait for Postgres to become available
run: |
until docker run --network container:postgres_postgres_1 postgres_postgres pg_isready -h postgres -p 5432 -U shillelagh --timeout=90; do sleep 10; done
Expand All @@ -46,4 +46,4 @@ jobs:
if: always()
run: |
docker logs postgres_postgres_1
docker-compose -f postgres/docker-compose.yml down
docker compose -f postgres/docker-compose.yml down
6 changes: 0 additions & 6 deletions .github/workflows/python-package-daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@ jobs:
run: |
python -m pip install --upgrade pip setuptools
python -m pip install -e '.[testing]'
- name: Install multicorn2
run: |
git clone https://github.com/pgsql-io/multicorn2.git
cd multicorn2
git checkout v2.5
pip install -e '.[testing]'
- name: Test with pytest
run: |
pytest --cov-fail-under=100 --cov=src/shillelagh -vv tests/ --doctest-modules src/shillelagh --without-integration --without-slow-integration
6 changes: 0 additions & 6 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,6 @@ jobs:
run: |
python -m pip install --upgrade pip setuptools
python -m pip install -r requirements/test.txt
- name: Install multicorn2
run: |
git clone https://github.com/pgsql-io/multicorn2.git
cd multicorn2
git checkout v2.5
pip install -r requirements/test.txt
- name: Test with pytest
run: |
pre-commit run --all-files
Expand Down
2 changes: 1 addition & 1 deletion docs/postgres.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ The ``postgres/`` directory has a Docker configuration that can be used to test

.. code-block:: bash
docker-compose up --build -d
docker compose up --build -d
You should then be able to run the example script in `examples/postgres.py`_ to test that everything works.
2 changes: 1 addition & 1 deletion examples/postgres.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Postgres with the extension and the Python packages. Just run:
$ cd postgres/
$ docker-compose up --build -d
$ docker compose up --build -d
Then you can run this script.
"""
Expand Down
28 changes: 24 additions & 4 deletions src/shillelagh/backends/multicorn/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
"""
A DB API 2.0 wrapper.
"""

import logging
import re
from typing import Any, Dict, List, Optional, Tuple, Type, Union, cast
from uuid import uuid4

import psycopg2
from multicorn import ForeignDataWrapper, Qual, SortKey
from psycopg2 import extensions

from shillelagh.adapters.base import Adapter
Expand All @@ -20,14 +20,12 @@
IntegrityError,
InterfaceError,
InternalError,
NotSupportedError,
OperationalError,
ProgrammingError,
Warning,
)
from shillelagh.lib import (
combine_args_kwargs,
deserialize,
escape_identifier,
find_adapter,
serialize,
Expand All @@ -46,7 +44,29 @@
Timestamp,
TimestampFromTicks,
)
from shillelagh.typing import Row

__all__ = [
"DatabaseError",
"DataError",
"Error",
"IntegrityError",
"InterfaceError",
"InternalError",
"OperationalError",
"BINARY",
"DATETIME",
"NUMBER",
"ROWID",
"STRING",
"Binary",
"Date",
"DateFromTicks",
"Time",
"TimeFromTicks",
"Timestamp",
"TimestampFromTicks",
"Warning",
]

apilevel = "2.0"
threadsafety = 2
Expand Down
1 change: 0 additions & 1 deletion src/shillelagh/backends/multicorn/dialects/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@


class Multicorn2Dialect(PGDialect_psycopg2):

"""
A SQLAlchemy dialect for Shillelagh based on psycopg2 and multicorn2.
"""
Expand Down

0 comments on commit 811de6d

Please sign in to comment.