Skip to main content

frostlake-dbt

The campaign to run dbt against Frostlake, in three steps:

  1. frostlake_connector (done) — a snowflake.connector-shaped facade over the frostlake Python driver.
  2. 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 in dbt-frostlake/.
  3. 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/port select the server; role, warehouse, database, schema become USE statements (in that order) and session_parameters/timezone become ALTER 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-style ResultMetadata descriptions with the connector's numeric type_code scheme (constants.FIELD_ID_TO_NAME), rowcount from DML, sfqid, iteration, context-manager use. DictCursor returns dicts.
  • Binding: pyformat by 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.
  • errors module: when the real snowflake-connector-python is installed (it always is under dbt-snowflake), its error classes are re-exported and raised, so existing except snowflake.connector.errors.ProgrammingError clauses catch facade errors; standalone, connector-shaped stand-ins with the same msg/errno/ sqlstate attributes are used. Engine compile errors surface as ProgrammingError(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)

Source distribution for frostlake-connector 0.1.0
File Size Uploaded
frostlake_connector-0.1.0.tar.gz 14.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for frostlake-connector 0.1.0
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page