Skip to content

Instantly share code, notes, and snippets.

View anna-geller's full-sized avatar

Anna Geller anna-geller

View GitHub Profile
id: your_flow_name
namespace: dev
tasks:
- id: dbt
type: io.kestra.core.tasks.flows.WorkingDirectory
tasks:
- id: cloneRepository
type: io.kestra.plugin.git.Clone
url: https://github.com/dbt-labs/jaffle_shop_duckdb
# in-process duckdb
jaffle_shop:
outputs:
dev:
type: duckdb
path: ':memory:'
extensions:
- parquet
target: dev
CREATE TABLE orders AS
SELECT *
FROM read_csv_auto('https://raw.githubusercontent.com/kestra-io/examples/main/datasets/orders.csv');
SELECT order_id,
hash(customer_name) as customer_name_hash,
md5(customer_email) as customer_email_hash,
product_id,
price,
quantity,
curl -o docker-compose.yml https://raw.githubusercontent.com/kestra-io/kestra/develop/docker-compose.yml
CREATE DATABASE orders;
CREATE TABLE orders.main.montly_orders as
SELECT month(order_date) as order_month, sum(total) as total
FROM read_csv_auto('s3://kestraio/monthly_orders/*.csv')
GROUP BY 1
ORDER BY 2 desc;
SELECT month(order_date) as order_month, sum(total) as total
FROM read_csv_auto('s3://kestraio/monthly_orders/*.csv')
GROUP BY 1
ORDER BY 2 desc;
import boto3
import requests
def extract_and_upload(file: str, bucket: str = "kestraio") -> None:
url = f"https://raw.githubusercontent.com/kestra-io/datasets/main/{file}"
response = requests.get(url)
data = response.content.decode("utf-8")
s3 = boto3.resource("s3")
id: airbyteDbtCore
namespace: dev
tasks:
- id: data-ingestion
type: io.kestra.core.tasks.flows.Parallel
tasks:
- id: psyduck
type: io.kestra.plugin.airbyte.connections.Sync
connectionId: 4de8ab1e-50ef-4df0-aa01-7f21491081f1
@anna-geller
anna-geller / terraform_ci_cd.tf
Created June 12, 2023 15:57
Deploy all flows that exist in the flows directory
terraform {
required_providers {
kestra = {
source = "kestra-io/kestra"
version = "~> 0.7.0"
}
}
}
provider "kestra" {
@anna-geller
anna-geller / test.yml
Created June 12, 2023 14:44
For Vicki
id: test
namespace: dev
tasks:
- id: deploy
type: io.kestra.core.tasks.flows.Worker
tasks:
- id: cloneRepository
type: io.kestra.plugin.git.Clone
url: https://github.com/veekaybee/viberary
branch: main