Skip to content

Commit

Permalink
Merge branch 'main' into guen/eco-25-sql-editor-multiple-main-schemas…
Browse files Browse the repository at this point in the history
…-appear-in-schema-dropdown
  • Loading branch information
guenp authored Dec 6, 2023
2 parents 027ea3b + 4ef3cfb commit e164935
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 29 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
on:
push:
branches:
- master
- main
workflow_dispatch:

name: release-please
jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v3
- run: npx release-please debug-config --repo-url https://github.com/Mause/duckdb_engine
- uses: google-github-actions/release-please-action@v4
with:
release-type: python
package-name: duckdb_engine
token: ${{ secrets.ACCESS_TOKEN }}
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.9.2"
".": "0.9.3"
}
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Changelog

## [0.9.3](https://github.com/Mause/duckdb_engine/compare/v0.9.2...v0.9.3) (2023-12-05)


### Bug Fixes

* use numeric_dollar where available ([f51ee7f](https://github.com/Mause/duckdb_engine/commit/f51ee7fb481f6e41e9d6636356edb81ee5e424cd))


### Documentation

* add directions for `alembic` support ([d549ba4](https://github.com/Mause/duckdb_engine/commit/d549ba497b1830b73b54dda4cd983ddb3114c150))
* update autoloading docs ([b782994](https://github.com/Mause/duckdb_engine/commit/b7829948114fb391918795a932564da2bbbb16db))
* update register docs ([9081ef7](https://github.com/Mause/duckdb_engine/commit/9081ef76cac0dd80b3922cc2b290724db17aa28e))
* update toc ([abcb158](https://github.com/Mause/duckdb_engine/commit/abcb158c42b734514028fbb9741c7c7dfa04f985))
* update toc ([#785](https://github.com/Mause/duckdb_engine/issues/785)) ([234a8b8](https://github.com/Mause/duckdb_engine/commit/234a8b801ffe4d236c8a790b880bc81207f37266))

## [0.9.2](https://github.com/Mause/duckdb_engine/compare/v0.9.1...v0.9.2) (2023-07-23)


Expand Down
13 changes: 8 additions & 5 deletions duckdb_engine/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@
from .config import apply_config, get_core_config
from .datatypes import ISCHEMA_NAMES, register_extension_types

__version__ = "0.9.2"
duckdb_version: str = duckdb.__version__ # type: ignore[attr-defined]
supports_attach = Version(duckdb_version) >= Version("0.7.0")
__version__ = "0.9.3"
sqlalchemy_version = Version(sqlalchemy.__version__)

if TYPE_CHECKING:
from sqlalchemy.base import Connection
Expand All @@ -44,7 +43,7 @@


class DBAPI:
paramstyle = duckdb.paramstyle
paramstyle = "numeric_dollar" if sqlalchemy_version >= Version("2.0.0") else "qmark"
apilevel = duckdb.apilevel
threadsafety = duckdb.threadsafety

Expand Down Expand Up @@ -139,7 +138,11 @@ def execute(
try:
if statement.lower() == "commit": # this is largely for ipython-sql
self.__c.commit()
elif statement.lower() in ("register", "register(?, ?)"):
elif statement.lower() in (
"register",
"register(?, ?)",
"register($1, $2)",
):
assert parameters and len(parameters) == 2, parameters
view_name, df = parameters
self.__c.register(view_name, df)
Expand Down
11 changes: 4 additions & 7 deletions duckdb_engine/tests/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,8 @@ def test_params(engine: Engine) -> None:


def test_361(engine: Engine) -> None:
importorskip("sqlalchemy", "2.0.0")

with engine.connect() as conn:
conn.execute(text("create table test (dt date);"))
conn.execute(text("insert into test values ('2022-01-01');"))
Expand All @@ -485,10 +487,5 @@ def test_361(engine: Engine) -> None:
part = "year"
date_part = func.date_part(part, test.c.dt)

stmt = (
select(date_part)
.select_from(test)
.group_by(date_part)
.compile(dialect=engine.dialect, compile_kwargs={"literal_binds": True})
)
conn.execute(stmt).fetchall()
stmt = select(date_part).select_from(test).group_by(date_part)
assert conn.execute(stmt).fetchall() == [(2022,)]
8 changes: 4 additions & 4 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "duckdb_engine"
version = "0.9.2"
version = "0.9.3"
description = "SQLAlchemy driver for duckdb"
authors = ["Elliana <[email protected]>"]
license = "MIT"
Expand Down
11 changes: 3 additions & 8 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
{
"packages": {
".": {
"releaseType": "python",
"package-name": "duckdb_engine",
"release-type": "python",
"draft": true,
"prerelease": false,
"bumpMinorPreMajor": false,
"bumpPatchForMinorPreMajor": true,
"changelogPath": "CHANGELOG.md",
"versioning": "default",
"extraFiles": [
"duckdb_engine/__init__.py"
]
"versioning": "default"
}
}
}

0 comments on commit e164935

Please sign in to comment.