dagster-io / dagster

An orchestration platform for the development, production, and observation of data assets.
https://dagster.io
Apache License 2.0
10.8k stars 1.35k forks source link

Automation UI not working with new AutomationConditions #22787

Closed ion-elgreco closed 1 week ago

ion-elgreco commented 2 weeks ago

Dagster version

1.7.12

What's the issue?

I created a new autoMaterializePolicy using the new AutomationConditions, since I needed some more flexibility of the rules.

However the UI doesn't work anymore:

Operation name: GetEvaluationsQuery

Message: Invariant failed.

Path: ["assetConditionEvaluationRecordsOrError"]

Locations: [{"line":19,"column":3}]

Stack Trace:
  File "/usr/local/lib/python3.10/site-packages/graphql/execution/execute.py", line 521, in execute_field
    result = resolve_fn(source, info, **args)
  File "/usr/local/lib/python3.10/site-packages/dagster_graphql/schema/roots/query.py", line 1151, in resolve_assetConditionEvaluationRecordsOrError
    return fetch_asset_condition_evaluation_records_for_asset_key(
  File "/usr/local/lib/python3.10/site-packages/dagster_graphql/implementation/fetch_asset_condition_evaluations.py", line 109, in fetch_asset_condition_evaluation_records_for_asset_key
    return _get_graphene_records_from_evaluations(
  File "/usr/local/lib/python3.10/site-packages/dagster_graphql/implementation/fetch_asset_condition_evaluations.py", line 58, in _get_graphene_records_from_evaluations
    records=[
  File "/usr/local/lib/python3.10/site-packages/dagster_graphql/implementation/fetch_asset_condition_evaluations.py", line 59, in <listcomp>
    GrapheneAssetConditionEvaluationRecord(
  File "/usr/local/lib/python3.10/site-packages/dagster_graphql/schema/asset_condition_evaluations.py", line 309, in __init__
    evaluation=GrapheneAssetConditionEvaluation(
  File "/usr/local/lib/python3.10/site-packages/dagster_graphql/schema/asset_condition_evaluations.py", line 255, in __init__
    evaluationNodes = [
  File "/usr/local/lib/python3.10/site-packages/dagster_graphql/schema/asset_condition_evaluations.py", line 256, in <listcomp>
    GraphenePartitionedAssetConditionEvaluationNode(evaluation, partitions_def)
  File "/usr/local/lib/python3.10/site-packages/dagster_graphql/schema/asset_condition_evaluations.py", line 161, in __init__
    trueSubset=GrapheneAssetSubset(evaluation.true_subset),
  File "/usr/local/lib/python3.10/site-packages/dagster_graphql/schema/asset_condition_evaluations.py", line 77, in __init__
    subsetValue=GrapheneAssetSubsetValue(asset_subset.subset_value),
  File "/usr/local/lib/python3.10/site-packages/dagster/_core/definitions/asset_subset.py", line 57, in subset_value
    check.invariant(isinstance(self.value, PartitionsSubset))
  File "/usr/local/lib/python3.10/site-packages/dagster/_check/__init__.py", line 1645, in invariant
    raise CheckError("Invariant failed.")

What did you expect to happen?

To work as before

How to reproduce?

No response

Deployment type

None

Deployment details

No response

Additional information

No response

Message from the maintainers

Impacted by this issue? Give it a 👍! We factor engagement into prioritization.

ion-elgreco commented 2 weeks ago

Actually this only happens when there are 0 evaluations available for that asset, for assets with an evaluation it works fine

ion-elgreco commented 2 weeks ago

Never mind this also happens on assets that should already have evaluations.

OwenKephart commented 2 weeks ago

Hi @ion-elgreco , do you have a repro for this? Looking into this from our side as well

ion-elgreco commented 2 weeks ago

@OwenKephart I honestly don't, it's happening across random assets. Whether they are partitioned or non partitioned

Do you have any suggestions how to reproduce?

OwenKephart commented 2 weeks ago

@ion-elgreco I was actually just able to reproduce this -- looking into a fix.

ion-elgreco commented 2 weeks ago

@ion-elgreco I was actually just able to reproduce this -- looking into a fix.

Awesome!