frostlake-dbt
The campaign to run dbt against Frostlake, in three steps:
frostlake_connector(done) — asnowflake.connector-shaped facade over thefrostlakePython driver.dbt-frostlake(done) — a thin adapter package that subclasses dbt-snowflake, overriding only the credentials shape and connection opening, so all of dbt-snowflake's macros and materializations run as-is. It lives indbt-frostlake/.- Grind dbt's standard acceptance suite (
dbt-tests-adapter) green; every failure is either a facade gap or a Frostlake SQL gap worth fixing.
Engine version
Requires a Frostlake engine 0.0.7 or newer. Ask a running server which one it is with
SELECT CURRENT_VERSION() — every release answers it, so the check works against any engine.
The adapter versions independently of the engine: it speaks the HTTP protocol, not the jar, so this is a floor rather than a lockstep pin.
The facade
import frostlake_connector as snowflake_connector
conn = snowflake_connector.connect(host="localhost", port=18082,
database="MY_DB", schema="PUBLIC",
warehouse="COMPUTE_WH",
session_parameters={"QUERY_TAG": "ci"})
cur = conn.cursor()
cur.execute("SELECT id, name FROM people WHERE id = %s", (1,))
print(cur.fetchall()) # [(1, 'Ada')]
Covered surface:
connect(**kwargs)with the connector's keyword vocabulary —host/portselect the server;role,warehouse,database,schemabecomeUSEstatements (in that order) andsession_parameters/timezonebecomeALTER SESSION SET; everything else (account,user,password,authenticator,client_session_keep_alive, …) is accepted and ignored.- Cursors:
execute(returns the cursor),executemany,fetchone/fetchmany/fetchall, connector-styleResultMetadatadescriptions with the connector's numerictype_codescheme (constants.FIELD_ID_TO_NAME),rowcountfrom DML,sfqid, iteration, context-manager use.DictCursorreturns dicts. - Binding:
pyformatby default (%s,%(name)s,%%— skipped inside string literals, quoted identifiers and comments),paramstyle="qmark"for?. execute_string()splits a script on top-level semicolons and returns the per-statement cursors.autocommit(mode),commit(),rollback(),is_closed(),session_id.errorsmodule: when the realsnowflake-connector-pythonis installed (it always is under dbt-snowflake), its error classes are re-exported and raised, so existingexcept snowflake.connector.errors.ProgrammingErrorclauses catch facade errors; standalone, connector-shaped stand-ins with the samemsg/errno/sqlstateattributes are used. Engine compile errors surface asProgrammingError(errno=1003, sqlstate="42000")(an approximation of the connector's numbering — Frostlake's message text is authoritative).
The transport is the frostlake PEP 249 driver,
which installs automatically as a dependency:
pip install frostlake-connector
Running the tests
export JAVA_HOME=/path/to/jdk17
export FROSTLAKE_CLASSPATH="/path/to/frostlake/engine/target/classes:<engine deps>"
python3 test/test_facade.py
The suite boots a real DatabaseHttpServer and covers connect-kwargs context
(CURRENT_DATABASE/CURRENT_SCHEMA/CURRENT_WAREHOUSE), binding in both
paramstyles, descriptions and type codes, DictCursor, executemany,
execute_string, the error shape, and dbt-style transaction sequences. Without
FROSTLAKE_CLASSPATH the integration tests skip and only the binding/split unit
tests run.
Metadata
Release files for frostlake-connector 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| frostlake_connector-0.1.0.tar.gz | 14.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| frostlake_connector-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 27.3 kB
Release files / frostlake_connector-0.1.0.tar.gz
| Download URL | frostlake_connector-0.1.0.tar.gz |
|---|---|
| Size | 14.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a9aee52a119b32bdb1fd297513a06f1456593467b3aa2a62d507efb60bd92be9
|
|
BLAKE2b-256 checksum How to use checksums |
19443fc88f468e8f362884faf935ab519c8ceab921ade98316a773154799696a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Release files / frostlake_connector-0.1.0-py3-none-any.whl
| Download URL | frostlake_connector-0.1.0-py3-none-any.whl |
|---|---|
| Size | 12.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c5ad1eb0e38836c3ddb61e6edd68de8bc39d1306de0790d57d40fae6b8191e2f
|
|
BLAKE2b-256 checksum How to use checksums |
9be9cf69b623d35dda7167a25137b0dc78f833c10946faa024ef2cd5cc82d608
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|