Parsing dbt tests with Github Actions

We’ve been using dbt for a while at my day job, and I love it. One of the key workflows we have on the Data & Analytics team is that every change must go through the Pull Request workflow on Github. Each Pull Request must be in a branch, then the tests run ontop of this on a subset of the production data. (more on this topic in a follow up post)....

October 15, 2021

Fixing Elixir Tzdata Updater Iex

[error] GenServer :tzdata_release_updater terminating ** (ArgumentError) argument error (stdlib) :ets.lookup_element(:hackney_config, :mod_metrics, 2) You hate to see it when running iex -S mix locally, basically it’s an issue where tzdata can’t update. You can fix this by either: Adding the following to your projects dev config: config :tzdata, :autoupdate, :disabled Adding the following snippet to your .iex.exs file: Application.put_env(:tzdata, :autoupdate, :disabled) You can read more about this on the tzdata README....

August 24, 2021

Showing debug trace information for hackney (HTTPoison) in IEx

Using IEx with a remote API with HTTPoison, it can be handy to show int he console the request and response you get back with hackney. You can do this by entering the following in iex: :hackney_trace.enable(:max, :io) You can also add this to .iex.exs file so it’ll always be added to your iex sessions by default so you don’t need to always retype it when needed. This will give you an output like this:...

August 24, 2021

How to test CORS with Plug/Phoenix

So you have setup your API to accept CORS requests on certain paths on your API using cors_plug or corsica and you are wondering how you test this with ExUnit. Back to basics: Does the endpoint actually work? Well the first thing to do is to check if your endpoint is actually working with CORS. You can do this via cURL: curl http://localhost:4000/api/posts -v -H "Origin: https://example.com" You will need to change the URL to your API Endpoint and your Origin to the URL you have allowed to access this endpoint....

August 24, 2021