Skip to content

Instantly share code, notes, and snippets.

View drewbanin's full-sized avatar
📈
We're hiring!

Drew Banin drewbanin

📈
We're hiring!
View GitHub Profile
{{
config(
materialized='incremental',
unique_key='id',
indexes=[
{'columns': ['id', 'name']},
]
)
}}
select
user_id,
starred_at as first_starred_at,
user,
_sdc_repository as repo_name
from {{ source('github', 'stargazers') }}
--filtering on the dbt repository
where repo_name in ('dbt-labs/dbt', 'dbt-labs/dbt-core')
import networkx as nx
def ancestors(graph, node, max_depth):
with nx.utils.reversed(graph):
anc = nx.single_source_shortest_path_length(G=graph, source=node, cutoff=max_depth).keys()
return anc - {node}
def descendants(graph, node, max_depth):

Hi Tomasz! Good to hear from you :D. I hope you're doing well!!

Here's how to trick out your terminal:

  • Install iTerm2 if you haven't already
  • Download a list of color schemes from here
    • Follow the instructions in the "Installation Instructions" section on this page

I use Afterglow, but you should pick whichever colorscheme you like best :p

Hi Janessa, this is a gist! You can comment on it, or you can "fork" it to iterate on your own copy :)
Runtime Error
Syntax error near line 20
------------------------------
17 | - "{{ reporting_schema_grants(schemas, 'reporter') }}"
18 |
19 | vars: []
20 | testing_days_of_data: 3
21 | 'snowplow:timezone': 'America/New_York'
22 | 'snowplow:page_ping_frequency': 10
23 | 'snowplow:events': "{{ ref('stg_snowplow_web_events') }}"
{% macro bigquery__get_catalog(information_schema, schemas) -%}
{%- if (schemas | length) == 0 -%}
{# Hopefully nothing cares about the columns we return when there are no rows #}
{%- set query = "select 1 as id limit 0" -%}
{%- else -%}
{%- set query -%}
with tables as (
select
{%- materialization view, default -%}
-- `BEGIN` happens here:
{{ run_hooks(pre_hooks, inside_transaction=True) }}
{% call statement('main') -%}
{{ create_view_as(intermediate_relation, sql) }}
{%- endcall %}
{{ adapter.rename_relation(intermediate_relation, target_relation) }}
with hourly_pressure as (
select
t as date_time
, t::date as date_day
, hour(t) as date_hour
, v:main:pressure::int as pressure_mbars
, pressure_mbars / 1000.0 as pressure_bars
, v:city.country as country
, v:city.name as city
Package Version
-------------------------- ---------
agate 1.6.1
asn1crypto 1.3.0
attrs 19.3.0
azure-common 1.1.25
azure-storage-blob 2.1.0
azure-storage-common 2.1.0
Babel 2.8.0
boto3 1.11.17