chore: add Redshift support - #453
Conversation
|
I'm still getting errors: |
|
It seems the error is related to a test run. Over the last year using my package I realized that at least one test out of the standard dbt column tests doesn't work with it (I don't remember now which one, I think it is related with column name test). |
|
So I deleted all tables and runned again. Now it does not fail but the tables are empty :D |
|
ok, After adding the upload hook everything works fine. |
|
Is it planned to get this merged ? We wanted to use this in production... |
|
Over a year and none of the main branch maintainers left a comment @jomach, so I don't think we will have it in the official package sadly. |
|
Can we ping someone ? The builds are failing |
|
maybe @jared-rimmer can take a look? |
Yeah. They've never been responsive at all lol. I gave up with the same issues of completely unrelated builds failing... |
|
I'm switching to elementary |
Update type_helpers.sql
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
dbt-core's MissingArgumentsPropertyInGenericTestDeprecation flags the old top-level generic-test-argument style; dbt >=1.12 with require_generic_test_arguments_property: true parses only the nested `arguments:` form. 11 sites across 10 bundled fct_dbt__* models used the old style (dbt_artifacts.is_between's min_value/max_value, and one accepted_values' values). Ran dbt Labs' dbt-autofix (`deprecations --path .`) to nest them under `arguments:`; kept only the models/*.yml changes (pure re-indentation plus the nesting) and reverted the tool's unrelated dbt_project.yml edit (a `False`->`false` casing tweak and a speculative `flags:` block), since this repo's own dbt_project.yml behavior flags are a separate decision for a different change, not implied by fixing these 11 deprecation sites. Verified via `uvx --from 'dbt-core>=1.12,<1.13' --with 'dbt-postgres>=1.11,<1.12' dbt parse --target postgres --project-dir integration_test_project --profiles-dir integration_test_project --no-partial-parse --show-all-deprecations`: zero MissingArgumentsPropertyInGenericTestDeprecation remain (the one remaining ProjectFlagsMovedDeprecation is pre-existing, unrelated, and lives in integration_test_project/profiles.yml, not touched here). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016CNVbr2GyVityjqt3LPAnU
One row per refable node describing the relation the most recent successful execution wrote, across models, seeds and snapshots. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016CNVbr2GyVityjqt3LPAnU
Prints dim_dbt__current_relations as a versioned JSON contract, documented in the README. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016CNVbr2GyVityjqt3LPAnU
resource_types is validated against the known set and target_name is escaped as a SQL string literal before either reaches the query text. database/schema reach the query indirectly via api.Relation.create(), whose quoting does not escape an embedded quote character either, so they get the same treatment: validated against a safe identifier pattern before being used to build the relation. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016CNVbr2GyVityjqt3LPAnU
Quote-doubling isn't a safe escape for target_name on every adapter this package supports: Snowflake, BigQuery, Spark and Databricks treat backslash as a string-literal escape character, so a value ending in an odd run of backslashes could desynchronise a doubled quote. Stop interpolating target_name into SQL entirely and filter matching rows in Jinja instead. Widen the database/schema identifier pattern to allow the characters real warehouse identifiers use (including the hyphens common in BigQuery project IDs) while still excluding quotes, semicolons, whitespace and backslashes. Treat an empty resource_types list as "export nothing" rather than building an invalid empty IN (). Make the top docstring precise about when the macro raises. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016CNVbr2GyVityjqt3LPAnU
…er nulls last Ranking success rows by node_id alone collapsed several targets writing to the same artifacts tables down to a single winner, so a node whose latest success ran on a different target than the one export_state's target_name argument requests was dropped instead of falling back to its own latest success on that target. Join stg_dbt__invocations in before ranking and partition by (node_id, target_name), making that the view's grain: one row per node per target. Add current_relation_id, a surrogate key of that grain (following the lineage_edge_id precedent) so it stays testable without a dbt_utils dependency, and update the schema tests and the raw-SQL uniqueness test to the new grain. Also order nulls last in the same ranking: NULLS FIRST is Postgres/Redshift's default for DESC, so a success with a null completion time would otherwise outrank a real one. The case-expression form is portable to every adapter this package supports, including SQL Server, which has no NULLS LAST clause. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016CNVbr2GyVityjqt3LPAnU
…mestamps dim_dbt__current_relations is now grained on (node_id, target_name). export_state's row loop filtered by target_name after the view had already collapsed to one row per node_id, so a node whose winning row belonged to a different target than requested was silently dropped rather than falling back to its own latest success on the requested target. With the view now returning up to one row per node per target, the loop only needs to pick the right row: a straight match when target_name is given (now correct, since every matching row is genuinely that node's row for that target), and the most recently completed success across targets when it isn't, preserving the single-target-project default of one row per node. Also fix last_success_at: `| string` produced Postgres's space-separated, offset-less format, contradicting the ISO 8601 promise in the README and the consuming repo's spec. A value with no tzinfo is UTC wall-clock time (every adapter this package writes to records query_completed_at from dbt's own UTC run-results timing), so attach UTC explicitly before calling isoformat(), which gives the `T` separator and offset uniformly across adapters. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016CNVbr2GyVityjqt3LPAnU
Overview
This is an update of @brendan-cook-87 PR for Redshift support.
Just changed the data type to SUPER for ARRAY and JSON.
Also merged the latest updates of the package.
I've tested it using Redshift and works fine.
Anyone wanting to test this can just add the package to your dbt project while this is not merged via:
Update type - breaking / non-breaking
What does this solve?
Outstanding questions
What databases have you tested with?