Just some notes/issues about driver development with Metabase v45.3, compared to v43.7.
This release includes a new driver for Athena. Unfortunately the upstream JDBC driver is not on maven central, so Metabase are hosting it on AWS. Using a third party repository seems to cause dependency problems for the Clojure tools.
Problem 1: the usual build commands fail, specifically when building the Athena driver, since the JDBC jar isn't found on the classpath or downloaded.
yarn install --frozen-lockfile --prefer-offline
./bin/build
Fix: for some reason, the dependency is resolved when using the Athena driver's own deps.edn
. This results in the driver jar being downloaded to ~/.m2/repository/com/metabase/athena-driver
. Then the above build commands can succeed.
cd modules/drivers/athena
clojure -X:deps prep
Problem 2: building a 3rd party driver copied (or symlink) into modules/drivers/my-driver
doesn't build: again because of Athena classpath issues (despite it building the main Metabase jar OK).
# Defined in my-driver/deps.edn as `:exec-fn build-drivers.build-driver/build-driver!`
DRIVERS=my-driver clojure -X:build
Fix: temporarily replace the original modules/drivers/deps.edn
content with an empty map {}
so that no other drivers are processed at all when building my-driver
.
mv "modules/drivers/deps.edn" "modules/drivers/deps.edn.original"
echo "{}" > "modules/drivers/deps.edn"
Problem 3: some tests related to the upcoming "apps" feature fail, where they expect certain card data to be returned by the API in response to "scaffolding". The data is created, but the test assertions (maybe intentionally) don't accept any other data. E.g. {"x": [{"y": "z"}]}
expected but {"x": [{"y": "z"}, {"a": "b"}]}
returned. 3 tests fail on the same type of assertion:
- metabase.api.app-test/scaffold-test (app_test.clj:176)
- metabase.api.app-test/scaffold-app-test (app_test.clj:223)
- metabase.api.app-test/scaffold-app-test (app_test.clj:248)
Fix: these tests relate to an unreleased feature and were subsequently deleted / moved as part of v46.0 preparation (PR 27413), so they could be ignored. Maybe it's a timezone issue or something, but they fail even for the postgres driver.
rm -f "test/metabase/api/app_test.clj"
Thanks for coming to my TED talk.