https://dagster.io/ logo
#dagster-support
Title
# dagster-support
b

Brooke Talcott

04/21/2022, 9:03 PM
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

prha

04/21/2022, 9:04 PM
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

Brooke Talcott

04/21/2022, 9:07 PM
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

prha

04/21/2022, 9:08 PM
is this in a loop, or is this the entire body of the sensor?
b

Brooke Talcott

04/21/2022, 9:09 PM
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

prha

04/21/2022, 9:11 PM
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

Brooke Talcott

04/21/2022, 9:12 PM
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

prha

04/21/2022, 10:26 PM
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

Brooke Talcott

04/21/2022, 10:33 PM
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

prha

04/21/2022, 10:36 PM
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

Brooke Talcott

04/21/2022, 10:36 PM
that would be stellar!
p

prha

04/21/2022, 10:37 PM
@Dagster Bot issue surfacing run_request based skip message instead of custom skip reason
d

Dagster Bot

04/21/2022, 10:37 PM
4 Views