Are the SkipReasons supposed to surface in dagit o...
# ask-community
b
Are the SkipReasons supposed to surface in dagit on the sensors page? I’m yielding a SkipReason with a message that I thought would show up but the tooltip in dagit shows the run was skipped because “the runs already exist for the existing keys”
p
Hi Brooke.
Are you yielding a single
SkipReason
for the entire evaluation? Or yielding
RunRequests
also?
SkipReasons should surface on the sensors page. The “runs already exist for the existing keys” tends to only show up if there were runs requested that were later skipped due to the idempotency checks
b
I was trying out a poor man’s CI/CD blob smirk
Copy code
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",
            )
p
is this in a loop, or is this the entire body of the sensor?
b
that is mostly the whole sensor
Copy code
@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}"
        )
p
hmm, yeah, I would expect that this would surface the SkipReason correctly. Is it possible that there was in fact a collision on run key (if the same run was requested within the same minute)?
Also, are there any informative output from the daemon logs?
b
I can try to change the run_key to something more granular but all the skip reasons have the same tooltip, will checkback in a few once I tried that out. the daemon logs show the message as expected
no change after making run key include seconds for the timestamp’d runkey
thanks for checking on this so promptly 🙂
p
so, every tick is still saying “runs already exist for the existing keys”?
What version of dagster are you using? What it be possible to paste a screenshot of a recently skipped tick?
b
yep, when it runs it runs and when it doesn’t it says ’0 runs requested, but skipped because the runs already exist for the requested keys”
Copy code
{
  "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 skipped
p
Yeah, this definitely sounds like a bug on our end… It’s too late to get a fix in for this week’s release, but I can try to get a repro and get a fix in for next week’s…
b
that would be stellar!
p
@Dagster Bot issue surfacing run_request based skip message instead of custom skip reason
d