Skip to content

Commit

Permalink
SQLAlchemy: Clean up and refactor SQLAlchemy polyfills
Browse files Browse the repository at this point in the history
... to `cratedb_toolkit.util.sqlalchemy`.
  • Loading branch information
amotl committed Jul 6, 2024
1 parent 19c5cff commit a654983
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 269 deletions.
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
- IO: Added the `if-exists` query parameter by updating to influxio 0.4.0.
- Rockset: Added CrateDB Rockset Adapter, a HTTP API emulation layer
- MongoDB: Added adapter amalgamating PyMongo to use CrateDB as backend
- SQLAlchemy: Clean up and refactor SQLAlchemy polyfills
to `cratedb_toolkit.util.sqlalchemy`

## 2024/06/18 v0.0.14
- Add `ctk cfr` and `ctk wtf` diagnostics programs
Expand Down
2 changes: 1 addition & 1 deletion cratedb_toolkit/adapter/pymongo/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import pymongo.collection

from cratedb_toolkit.adapter.pymongo.collection import collection_factory
from cratedb_toolkit.sqlalchemy.patch import patch_types_map
from cratedb_toolkit.util import DatabaseAdapter
from cratedb_toolkit.util.pandas import patch_pandas_sqltable_with_extended_mapping
from cratedb_toolkit.util.sqlalchemy import patch_types_map


class PyMongoCrateDBAdapter:
Expand Down
2 changes: 1 addition & 1 deletion cratedb_toolkit/adapter/pymongo/backlog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Iteration +1
- Upstream / converge patches.
- `cratedb_toolkit/sqlalchemy/patch.py`
- `cratedb_toolkit/util/sqlalchemy.py`
- `cratedb_toolkit/util/pandas.py`
- `cratedb_toolkit/adapter/pymongo/api.py::adjust_sqlalchemy`
- `cratedb_toolkit/adapter/pymongo/collection.py::insert_returning_id`
Expand Down
2 changes: 1 addition & 1 deletion cratedb_toolkit/cfr/systable.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
import sqlalchemy as sa
from tqdm import tqdm

from cratedb_toolkit.sqlalchemy.patch import patch_encoder
from cratedb_toolkit.util import DatabaseAdapter
from cratedb_toolkit.util.cli import error_logger
from cratedb_toolkit.util.sqlalchemy import patch_encoder
from cratedb_toolkit.wtf.core import InfoContainer

logger = logging.getLogger(__name__)
Expand Down
1 change: 0 additions & 1 deletion cratedb_toolkit/sqlalchemy/__init__.py

This file was deleted.

113 changes: 0 additions & 113 deletions cratedb_toolkit/sqlalchemy/polyfill.py

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
"""
Patches and polyfills, mostly for SQLAlchemy.
TODO: Refactor to `crate` or `sqlalchemy-cratedb` packages.
"""

import calendar
import datetime as dt
import json
Expand Down
2 changes: 1 addition & 1 deletion tests/sqlalchemy/test_patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import pytest
import sqlalchemy as sa

from cratedb_toolkit.sqlalchemy.patch import CrateJsonEncoderWithNumPy
from cratedb_toolkit.util.sqlalchemy import CrateJsonEncoderWithNumPy
from tests.conftest import TESTDRIVE_DATA_SCHEMA


Expand Down
151 changes: 0 additions & 151 deletions tests/sqlalchemy/test_polyfill.py

This file was deleted.

0 comments on commit a654983

Please sign in to comment.