Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,19 @@ Please see [MIGRATING.md](./MIGRATING.md) for information on breaking changes.

### Removed

## [3.1.4] - September 2025

## [3.1.3] - September 2025
### Fixed
- Fixed `connect_db` method return value for default :memory: connections
- Fixed flaky end to end test for source records in the snapshot environment

### Added
## [3.1.3] - September 2025

### Fixed
- Fixed multiple sequential newline characters in srs download
- Fixed edge cases around non-default sorts and pagination
- Unexposed an accidentally exposed internal module

### Changed

### Removed

## [3.1.2] - August 2025

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "pdm.backend"

[project]
name = "ldlite"
version = "3.1.3"
version = "3.1.4"
description = "Lightweight analytics tool for FOLIO services"
authors = [
{name = "Katherine Bargar", email = "[email protected]"},
Expand Down
2 changes: 1 addition & 1 deletion src/ldlite/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def _connect_db_duckdb(
self.dbtype = DBType.DUCKDB
fn = filename if filename is not None else ":memory:"
db = duckdb.connect(database=fn)
self.db = cast("dbapi.DBAPIConnection", duckdb.connect(database=fn))
self.db = cast("dbapi.DBAPIConnection", db)
return db

def connect_db_postgresql(self, dsn: str) -> psycopg2.extensions.connection:
Expand Down
17 changes: 9 additions & 8 deletions tests/test_endtoend.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from dataclasses import astuple
from typing import cast

import duckdb
import pytest
from httpx_folio.factories import FolioParams, default_client_factory
from httpx_folio.query import QueryParams, QueryType
Expand Down Expand Up @@ -33,7 +32,7 @@ def test_endtoend(
from ldlite import LDLite as uut

ld = uut()
ld.connect_db(":memory:shared")
db = ld.connect_db()

ld.page_size = 3
ld.connect_folio(*astuple(folio_params[1]))
Expand All @@ -49,7 +48,6 @@ def test_endtoend(
expected = res.json()["totalRecords"]
assert expected > 3

db = duckdb.connect(":memory:shared")
db.execute("SELECT COUNT(DISTINCT COLUMNS(*)) FROM test__t;")
actual = cast("tuple[int]", db.fetchone())[0]

Expand All @@ -60,14 +58,17 @@ def test_endtoend_srs(folio_params: tuple[bool, FolioParams]) -> None:
from ldlite import LDLite as uut

ld = uut()
ld.connect_db(":memory:shared")
db = ld.connect_db()

ld.connect_folio(*astuple(folio_params[1]))
ld.query(table="test", path="/source-storage/source-records", limit=4)
ld.query(table="test", path="/source-storage/source-records", limit=10)

db = duckdb.connect(":memory:shared")
db.execute("SELECT COUNT(DISTINCT COLUMNS(*)) FROM test__t;")
actual = cast("tuple[int]", db.fetchone())[0]

# snapshot only has 4 records
assert actual == 4
# snapshot a variable number of records
assert actual >= 1
if folio_params[0]:
assert actual <= 10
else:
assert actual == 10
Loading