Skip to content

Instantly share code, notes, and snippets.

View matepaavo's full-sized avatar

Balázs Máté matepaavo

  • ingatlan.com
  • Hungary
View GitHub Profile
@matepaavo
matepaavo / dbt-docs-check.py
Created June 14, 2020 14:50
Utility to check and score your dbt documentation
'''
dbt Documentation Checker
'''
import argparse
import json
import logging
import sys
import urllib.parse as url_parse
@matepaavo
matepaavo / bq-utils-copy-example.py
Created January 14, 2019 19:13
bq-utils-copy-example
from google.cloud import bigquery
from bqutils.bigquery_description_manager import BigQueryDescriptionManager
bq_client = bigquery.Client()
description_manager = BigQueryDescriptionManager(bq_client)
source_table_id = 'your_project.your_dataset.source_table'
target_table_id = 'your_project.other_dataset.target_view'
description_manager.copy_field_descriptions(source_table_id, target_table_id)
@matepaavo
matepaavo / bq-utils-upload-example.py
Last active June 25, 2021 14:56
bq-utils-upload_example
from google.cloud import bigquery
from bqutils.bigquery_description_manager import BigQueryDescriptionManager
bq_client = bigquery.Client()
description_manager = BigQueryDescriptionManager(bq_client)
descriptions_csv_path = 'ga_descriptions.csv'
target_table_id = 'your_project.your_dataset.target_table'
description_manager.upload_field_descriptions(descriptions_csv_path, target_table_id)
#Get indeces
GET _cat/indices
#Create ads index with mappings
PUT ads
{
"settings": {
"index": {
"number_of_shards": 1,
"number_of_replicas": 0