Skip to content

Instantly share code, notes, and snippets.

View schrockn's full-sized avatar

Nick Schrock schrockn

View GitHub Profile
import os
from dagster import pipeline, solid, FileHandle, execute_pipeline, DagsterInstance
import dagster_pandas
import pandas as pd
@solid
def load_dataframe(_) -> dagster_pandas.DataFrame:
# get this instead from previous computation
return pd.DataFrame({'nums': [1, 2]})
templated_command = """
{% for i in range(5) %}
echo "{{ ds }}"
{% endfor %}
"""
t3 = BashOperator(
task_id='templated',
bash_command=templated_command,
dag=dag)
from dagster import ScheduleDefinition, schedules
from dagster_cron import SystemCronScheduler
@schedules(scheduler=SystemCronScheduler)
def define_hello_world_schedules():
return [
ScheduleDefinition(
name='hello_world_every_min',
cron_schedule='* * * * *',
pipeline_name='hello_world_pipeline'
repository:
file: hello_world.py
fn: define_hello_world_rep
from dagster import solid, pipeline, RepositoryDefinition
# pipeline from above
def define_hello_world_repo():
return RepositoryDefinition(
name='hello_world_repo',
pipeline_defs=[hello_world_pipeline]
)
from dagster import solid, pipeline, RepositoryDefinition
@solid
def hello_world_solid(context):
context.log.info('Hello, World!')
@pipeline
def hello_world_pipeline():
hello_world_solid() # DSL for building dependency graph
class Foo:
  pass
  
{
"python.unitTest.pyTestArgs": [
"dagster/dagster_tests/core_tests",
"dagit/dagit_tests/test_graphql.py"
],
"python.analysis.disabled": [
"unresolved-import"
],
"python.unitTest.pyTestEnabled": true,
"python.pythonPath": "/Users/schrockn/code/venvs/dagster-3.7.1/bin/python",
This file has been truncated, but you can view the full file.
.
├── .DS_Store
├── .coverage
├── .pylintrc -> ../.pylintrc
├── .pytest_cache
│   └── v
│   └── cache
│   └── nodeids
├── .style.yapf -> ../.style.yapf
├── .tox
This file has been truncated, but you can view the full file.
.
├── .DS_Store
├── .coverage
├── .pylintrc -> ../.pylintrc
├── .pytest_cache
│   └── v
│   └── cache
│   └── nodeids
├── .style.yapf -> ../.style.yapf
├── .tox