Giter Site home page Giter Site logo

NoneType has no len() error. about snowplow HOT 7 OPEN

dbt-labs avatar dbt-labs commented on July 3, 2024
NoneType has no len() error.

from snowplow.

Comments (7)

joshuaLW avatar joshuaLW commented on July 3, 2024 1

@jtcohen6 good shout. I've just tried emptying the packages.yml then running dbt clean and i'm getting the errors i expected eg. "model x depends on y" so i'll keep going with cleaning up my models till all dependancies are removed... and hopefully it was just that... :) FWIW I thought dbt clean would have cleaned my packages.yml too... but computers can't read my mind can they?

from snowplow.

jtcohen6 avatar jtcohen6 commented on July 3, 2024

Hey @joshuaLW, this is indeed a cryptic error. The question of removing the Snowplow package seems like a good place to start debugging.

  • Do you have anything else in packages.yml?
  • Do you still have references to the snowplow package in dbt_project.yml?

from snowplow.

joshuaLW avatar joshuaLW commented on July 3, 2024

@jtcohen6 three things... I never actually checked that the snowplow modules were removed from packages.yml when i ran "dbt clean" but now having reversed these changes with "dbt deps" I've only this in that file:
packages:

  • package: fishtown-analytics/snowplow
    version: 0.11.0

I did comment out all variables and models referencing the snowplow package in the project.yml

I didn't remove all dependencies upon snowplow from my models but i expected to get an error of the kind model x refers to model y that does not exist.

I'm going to go at it that way now actually: i'm going to remove references to snowplow models in my models first and then try removing snowplow module again.

from snowplow.

jtcohen6 avatar jtcohen6 commented on July 3, 2024

I did comment out all variables and models referencing the snowplow package in the project.yml

If I had to pick one of the three as the likeliest cause, I'd say it's this one. Try removing snowplow from packages.yml, run dbt clean, leave the vars in place, and then see what error you get back. (I hope it will be of the missing-ref kind.)

from snowplow.

joshuaLW avatar joshuaLW commented on July 3, 2024

@jtcohen6 So the plot thickens: the error returns even with packages.yml empty. It seems to be connected to one of the models I pinched from the package.
so to recap:

  1. i installed snowplow with dbt deps
  2. copied three models from the module into my models
  3. cleared packages.yml of its content
  4. ran dbt clean
  5. dbt docs generate (any other cmd get's the same result) and i get the "object of type 'NoneType' has no len()"

from snowplow.

joshuaLW avatar joshuaLW commented on July 3, 2024

@jtcohen6 yup i found the line that was causing the problem. It was a reference to a variable that was nested in the package i'd removed.
image

from snowplow.

jtcohen6 avatar jtcohen6 commented on July 3, 2024

There it is! Well found.

I think it would be an improvement to the snowplow package if its models handled better the case when var('snowplow:pass_through_columns') is undefined in the project (None), rather than merely empty ([]).

Perhaps by rewriting that line to be:

{% if var('snowplow_pass_through_columns', []) | length > 0 %}

That way, if you do want to copy-paste the model code into your own project, and (sensibly) remove the snowplow-specific vars from your project config, you won't be stymied by a cryptic error.

I'm going to transfer this issue to the snowplow package repository, since that's where the change should take place.

from snowplow.

Related Issues (20)

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.