Brooke Talcott
04/21/2022, 9:03 PMprha
04/21/2022, 9:04 PMSkipReason
for the entire evaluation? Or yielding RunRequests
also?Brooke Talcott
04/21/2022, 9:07 PMif filecmp.cmp("./staging_repo.py", "./production_repo.py"):
yield SkipReason("Staging and Production environments are the same")
else:
yield RunRequest(
run_key=f"{dt.now().strftime('%Y%m%d%H%M')}",
job_name="copy_staging_to_prod_job",
)
prha
04/21/2022, 9:08 PMBrooke Talcott
04/21/2022, 9:09 PM@sensor(job=copy_staging_to_prod_job)
def staging_to_prod_sensor():
from dagster_graphql import (
ReloadRepositoryLocationInfo,
ReloadRepositoryLocationStatus,
DagsterGraphQLClient,
)
client = DagsterGraphQLClient("localhost", port_number=3000)
reload_info: ReloadRepositoryLocationInfo = client.reload_repository_location(
"staging_repo.py"
)
if reload_info.status == ReloadRepositoryLocationStatus.SUCCESS:
if filecmp.cmp("./staging_repo.py", "./production_repo.py"):
yield SkipReason("Staging and Production environments are the same")
else:
yield RunRequest(
run_key=f"{dt.now().strftime('%Y%m%d%H%M')}",
job_name="copy_staging_to_prod_job",
)
else:
raise Exception(
"Repository location reload failed because of a "
f"{reload_info.failure_type} error: {reload_info.message}"
)
prha
04/21/2022, 9:11 PMBrooke Talcott
04/21/2022, 9:12 PMprha
04/21/2022, 10:26 PMBrooke Talcott
04/21/2022, 10:33 PM{
"dagit_version": "0.14.9",
"dagster_version": "0.14.9",
"dagster_graphql_version": "0.14.9"
}
interestingly, when trying to get the screenshot I noticed the status was very briefly showing “Started” (maybe it said requested I don’t remember) then snapped back to skippedprha
04/21/2022, 10:36 PMBrooke Talcott
04/21/2022, 10:36 PMprha
04/21/2022, 10:37 PMDagster Bot
04/21/2022, 10:37 PM