Git Product home page Git Product logo

dbt-devnull's People

Contributors

bachng2017 avatar jice-lavocat avatar

Stargazers

 avatar

Watchers

 avatar

dbt-devnull's Issues

Making the dbt-devnull adapter flexible for more DB types

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.

ERROR: get_columns_in_relation macro not implemented for adapter devnull

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 []

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.