bachng2017 / dbt-devnull Goto Github PK
View Code? Open in Web Editor NEWa do-nothing dbt plugin adapter
License: Apache License 2.0
a do-nothing dbt plugin adapter
License: Apache License 2.0
Currently DevNullAdapter
inherits from SQLAdapter
.
This introduces several specific behaviors that will lead to unexpected parsing effects when using linters such as SQLFluff.
For instance, the {{ source(a,b) }}
or {{ ref(a) }}
method use some specific quotes in BigQuery (instead of "
it should be using `
).
This results in SQLFuff returning failures similar to Found unparsable section: ...
--
One solution I've been using, but which requires having a fork was to change the impl.py file from
from dbt.adapters.sql import SQLAdapter
from dbt.adapters.devnull import DevNullConnectionManager
from dbt.adapters.base.relation import BaseRelation
class DevNullAdapter(SQLAdapter):
ConnectionManager = DevNullConnectionManager
...
to
from dbt.adapters.bigquery import BigQueryAdapter
from dbt.adapters.devnull import DevNullConnectionManager
from dbt.adapters.base.relation import BaseRelation
class DevNullAdapter(BigQueryAdapter):
ConnectionManager = DevNullConnectionManager
...
I'm pretty sure that there could be a better way to make the devnull adapter more flexible but I'm not a dev guy, so I can't really suggest better.
Some macros such as dbt_utils.union_relations
use an adapter method named get_columns_in_relation
that is not implemented in the devnull adapter so far.
--
To reproduce, install dbt_utils
and try something like the following:
Create two dumb models model1
and model2
then
failing_model.sql:
{{ dbt_utils.union_relations(
relations = [
ref('model1'),
ref('model2')
]
) }}
--
To fix, in impl.py add the following method.
def get_columns_in_relation(self, relation: BaseRelation):
return []
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.