raaid
02/24/2021, 2:10 PMdhume
02/24/2021, 3:18 PMraaid
02/24/2021, 3:34 PMdhume
02/24/2021, 3:36 PMlocal
and dev
you could set your modes like this
local = ModeDefinition(
name="local",
resource_defs={
"data_lake": mock_s3,
"snowflake": mock_snowflake,
"ge_data_context": ge_data_context,
},
description="Local mode of pipelines (No AWS, Dev/Local Resources)",
)
dev = ModeDefinition(
name="dev",
description="Dev mode of pipelines (Dev AWS, Dev Resources)",
intermediate_storage_defs=s3_plus_default_intermediate_storage_defs,
resource_defs={
"s3": s3_resource,
"data_lake": s3,
"snowflake": mock_snowflake,
"ge_data_context": ge_data_context,
},
)
Then have different presets
dev preset
dev_run_config = {
"resources": {
"snowflake": {
"config": {"file_path": file_relative_path(__file__, "data")}
},
"data_lake": {"config": {"bucket": DAGSTER_BUCKET_DEV}},
"ge_data_context": {
"config": {
"ge_root_dir": file_relative_path(
__file__, "great_expectations"
)
}
},
},
"solids": {
"store_order_items": {
"inputs": {"query": {"value": "xxx.csv"}}
}
},
"intermediate_storage": {
"s3": {
"config": {
"s3_bucket": DAGSTER_BUCKET_DEV,
"s3_prefix": S3_PREFIX,
}
}
},
}
local preset
local_run_config = {
"resources": {
"snowflake": {
"config": {"file_path": file_relative_path(__file__, "data")}
},
"ge_data_context": {
"config": {
"ge_root_dir": file_relative_path(
__file__, "great_expectations"
)
}
},
},
"solids": {
"store_order_items": {
"inputs": {"query": {"value": "xxx.csv"}}
}
},
}
raaid
02/24/2021, 4:01 PMCharles Lariviere
03/01/2021, 8:17 PMmock_snowflake
resource for local/dev; are you simply wrapping a LIMIT
statement around queries, or are you completely abstracting from making requests to Snowflake?
I’m currently working on setting up unit tests and would ideally like to fully abstract from making requests. 🤔dhume
03/01/2021, 8:26 PMmock_snowflake
resource just reads files that contain results equivalent to the query responses. So people can run tests and make changes all they want without actually pinging Snowflake. In dev we have an actual snowflake connection and query usually with a LIMIT or targeting a staging database and in prod we have the query no LIMITCharles Lariviere
03/01/2021, 8:29 PM