Skip to content

Instantly share code, notes, and snippets.

View tanaysd's full-sized avatar
🎯
Focusing

Tanay Sood tanaysd

🎯
Focusing
View GitHub Profile
from dataclasses import dataclass
@dataclass
class SimpleDataObject(object):
'''
In this case,
__init__, __repr__, __eq__, will all be generated automatically.
'''
field_a: int
@robert8138
robert8138 / toy_DAG_definition_file.py
Last active December 26, 2019 14:50
A toy example of a DAG definition file in Airflow
"""
A DAG docstring might be a good way to explain at a high level
what problem space the DAG is looking at.
Links to design documents, upstream dependencies etc
are highly recommended.
"""
from datetime import datetime, timedelta
from airflow.models import DAG # Import the DAG class
from airflow.operators.sensors import NamedHivePartitionSensor
from airflow.operators.hive_operator import HiveOperator
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@iconara
iconara / queries.sql
Last active November 13, 2023 22:26
Low level Redshift cheat sheet
-- Table information like sortkeys, unsorted percentage
-- see http://docs.aws.amazon.com/redshift/latest/dg/r_SVV_TABLE_INFO.html
SELECT * FROM svv_table_info;
-- Table sizes in GB
SELECT t.name, COUNT(tbl) / 1000.0 AS gb
FROM (
SELECT DISTINCT datname, id, name
FROM stv_tbl_perm
JOIN pg_database ON pg_database.oid = db_id