Describe the bug
The dataset where external tables are created does not always get automatically created.
Steps to reproduce
Manually create a dataset where your external table is supposed to be created in then immediately drop it, stage your external table and you should get an error saying the dataset does not exist.
I'm thinking there may be a lag between the dataset being dropped and when the data gets updated in the SCHEMATA table (which this macro uses) to determine if a dataset exists or not.
Expected results
dataset gets created before external table is created
Actual results
Screenshots and log output
System information
The contents of your packages.yml file:
Which database are you using dbt with?
The output of dbt --version:
The operating system you're using:
The output of python --version:
Additional context