Bob
02/13/2020, 2:45 PM# Bigquery
@resource(config={"project": Field(str), "service_account": Field(str)})
def bigquery_resource(init_context):
os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = init_context.resource_config["service_account"]
project_id = init_context.resource_config["project"]
client = bigquery.Client(project=project_id)
return client
and enviroment yaml specification
bigquery:
config:
project: "private-project"
service_account: "./GoogleCloud_ServiceAccount.json"
abhi
02/13/2020, 3:02 PMenvironment_vars
parameter. Here is an example: https://github.com/dagster-io/dagster/blob/master/examples/dagster_examples/bay_bikes/schedules.py#L15. The reason for this, I believe, is due to some annoying constraints set by cron.Bob
02/14/2020, 10:35 AM""" Load Resource Config"""
with open(
file_relative_path(__file__, "pipelines/environments/docker_dev.yaml"), "r"
) as yaml_in:
config = yaml.safe_load(yaml_in) # yaml_object will be a list or a dict
""" Individual Pipeline Schedules"""
test_slack_schedule = ScheduleDefinition(
name="test_slack_schedule",
cron_schedule="*/1 * * * *",
pipeline_name="test_slack_pipeline",
mode=mode,
environment_dict=config,
)