-
Notifications
You must be signed in to change notification settings - Fork 9
fix(ingestion): heal Decimal jira id columns on warm clusters (#1743) #1940
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
75dda6c
6279b88
e21b15f
91d984e
a45ab84
f8d0d2a
b89284c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,8 +6,10 @@ How it works: for every connector the source image runs `discover` (schemas are | |
|
|
||
| ## Prerequisites | ||
|
|
||
| - `docker`, `jq`, `yq` (mikefarah v4), `dbt` with `dbt-clickhouse` | ||
| - ClickHouse reachable under `CLICKHOUSE_HOST` both from this machine (dbt) and from inside docker containers (destination connector). For a ClickHouse running on this machine use `host.docker.internal`. | ||
| - `docker`, `jq`, `yq` (mikefarah v4) | ||
| - `python3.12` or `python3.11` on `PATH` — `run-dbt.sh` builds a local `.venv` with the pinned dbt from it (parity with the toolbox image; dbt-core 1.10 does not run on newer pythons). A `python -m venv`-capable interpreter is required (uv-managed pythons lack `ensurepip`; with those, pre-build the venv via `uv venv --seed .venv && .venv/bin/pip install dbt-core==<pin> dbt-clickhouse==<pin>`). | ||
| - ClickHouse reachable under `CLICKHOUSE_HOST` both from this machine (dbt) and from inside docker containers (destination connector). For a ClickHouse running on this machine use the machine's LAN IP (`ipconfig getifaddr en0`) — `host.docker.internal` resolves inside containers but not on the macOS host itself. | ||
| - Real HubSpot and Salesforce credentials in `.env` — their CDK `discover` calls the live APIs, so fake values fail. Without credentials, seed their bronze from the committed snapshot instead: apply `scripts/connectors-ddl/{hubspot,salesforce}.sql`, run `./run-dbt.sh --select hubspot__bronze_promoted salesforce__bronze_promoted`, and continue from the dbt step. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win Fix the fallback snapshot path consistently. Both instructions use a repository-root-relative path while the documented bootstrap flow runs from
📍 Affects 2 files
🤖 Prompt for AI Agents |
||
|
|
||
| ## Local ClickHouse for testing | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,7 +16,10 @@ set +a | |
|
|
||
| VENV_DIR="${SCRIPT_DIR}/.venv" | ||
| DBT_BIN="${VENV_DIR}/bin/dbt" | ||
| if [[ ! -x "${DBT_BIN}" ]] || ! "${VENV_DIR}/bin/pip" show dbt-clickhouse 2>/dev/null | grep -q "Version: ${DBT_CLICKHOUSE_VERSION}"; then | ||
| # No `pip show | grep -q`: grep -q exits at first match, pip dies on EPIPE and | ||
| # pipefail fails the check for a perfectly good venv (which then gets rm -rf'd). | ||
| INSTALLED="$("${VENV_DIR}/bin/pip" show dbt-clickhouse 2>/dev/null || true)" | ||
| if [[ ! -x "${DBT_BIN}" ]] || [[ "${INSTALLED}" != *"Version: ${DBT_CLICKHOUSE_VERSION}"* ]]; then | ||
|
Comment on lines
+19
to
+22
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== locate file =="
fd -a 'run-dbt\.sh' . || true
echo "== file excerpt =="
if [ -f src/ingestion/scripts/bootstrap-db/run-dbt.sh ]; then
nl -ba src/ingestion/scripts/bootstrap-db/run-dbt.sh | sed -n '1,80p'
fi
echo "== dbt version variables/usages =="
rg -n "DBT_(CLICKHOUSE|CORE)_VERSION|dbt-clickhouse|dbt-core|pip.*(show|install)" src/ingestion || true
echo "== deterministic behavior probe for bash substring matches =="
python3 - <<'PY'
import shlex, subprocess, sys
cases = [
("1.10.0", "1.10.0"),
("1.10.0rc1", "1.10.0"),
("1.10.0.post1", "1.10.0"),
("2.10.0", "1.10.0"),
("1.10.0", "1.10.0dev"),
]
for expected, actual in cases:
installed = f'Name: dbt-clickhouse\nVersion: {actual}'
bash = f'INSTALLED=$\'{installed.replace(chr(10), "\\n").replace("Name", "\\\\nName").replace("Version", "\\\\nVersion")}\'\n[[ $INSTALLED == *"Version: ${expected}"* ]]'
res = subprocess.run(["bash","-c", bash], stdin=subprocess.DEVNULL, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
print(f"expected={expected!r} actual={actual!r} accepted={res.returncode==0}")
PYRepository: constructorfabric/insight Length of output: 305 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== file excerpt =="
if [ -f src/ingestion/scripts/bootstrap-db/run-dbt.sh ]; then
awk '{printf "%6d\t%s\n", NR, $0}' src/ingestion/scripts/bootstrap-db/run-dbt.sh | sed -n '1,90p'
fi
echo "== dbt version variables/usages =="
if command -v rg >/dev/null 2>&1; then
rg -n "DBT_(CLICKHOUSE|CORE)_VERSION|dbt-clickhouse|dbt-core|pip.*(show|install)" src/ingestion || true
else
grep -RInE "DBT_(CLICKHOUSE|CORE)_VERSION|dbt-clickhouse|dbt-core|pip.*(show|install)" src/ingestion || true
fi
echo "== deterministic behavior probe =="
python3 - <<'PY'
import subprocess
cases = [
("1.10.0", "1.10.0"),
("1.0.0", "1.10.0"),
("1.10.0rc1", "1.10.0"),
("1.10.0.post1", "1.10.0"),
("dbt-core1.10.0rc1", "1.10.0"),
]
for expected, actual in cases:
installed = "Name: dbt-clickhouse\nVersion: " + actual
bash = 'INSTALLED=$' + repr(installed) + '\n[[ "${INSTALLED}" != *"Version: ' + expected + '*" ]] && echo reject || echo accept'
res = subprocess.run(["bash","-c", bash], stdin=subprocess.DEVNULL, text=True, stdout=subprocess.PIPE)
print(f"expected={expected!r} actual={actual!r} returncode={res.returncode} output={res.stdout.strip()}")
PYRepository: constructorfabric/insight Length of output: 7176 Validate both pinned dbt versions with exact comparisons. The current reuse guard only checks 🤖 Prompt for AI Agents |
||
| PYTHON_BIN="$(command -v python3.12 || command -v python3.11)" | ||
| : "${PYTHON_BIN:?python3.12 or python3.11 is required to run dbt (same major as the toolbox image)}" | ||
| rm -rf "${VENV_DIR}" | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Make the ClickHouse host instructions consistent.
Line 11 now correctly says host-based dbt should use the machine LAN IP, but the local example at Line 25 still sets
CLICKHOUSE_HOST=host.docker.internaland claims it works for dbt. On macOS, following that example makes host-side dbt unable to resolve ClickHouse; update the example to match this prerequisite or explicitly scopehost.docker.internalto containers only.🤖 Prompt for AI Agents