Skip to content

When using observable_source_asset and DataVersionsByPartition, the input_data_version appears to be broken #33988

Description

@AbhinavPraveen

What's the issue?

When using observable_source_asset and dataset_partitions_test, the input_data_version appears to be broken

What did you expect to happen?

After running the below example and viewing the partition in the dagster ui, the partitions appear to have an input_data_version/code_partitions_test value of e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 and an input_data_version/dataset_partitions_test value of e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855. But this sha256sum is that of an empty file (e.g. cat /dev/null | sha256sum) meaning that the sha256sum is meaningless. Ideally, I would prefer these to have the values given by dg.DataVersionsByPartition (e.g. 3) for interpretability.

How to reproduce?

import dagster as dg
import time

datasets_test = dg.DynamicPartitionsDefinition(name="datasets_test")
codes_test = dg.DynamicPartitionsDefinition(name="codes_test")
effctivepartitions = dg.MultiPartitionsDefinition({
  "datasets_test": datasets_test,
  "codes_test": codes_test
})

@dg.observable_source_asset(partitions_def=datasets_test)
def dataset_partitions_test(context):
  context.instance.add_dynamic_partitions(datasets_test.name, ["a", "b"])
  out = {"a": dg.DataVersion(str(time.time())), "b": dg.DataVersion("2")}
  return dg.DataVersionsByPartition(out)

@dg.observable_source_asset(partitions_def=codes_test)
def code_partitions_test(context):
  context.instance.add_dynamic_partitions(codes_test.name, ["c", "d"])
  out = {"c": dg.DataVersion("3"), "d": dg.DataVersion("4")}
  return dg.DataVersionsByPartition(out)

@dg.asset(partitions_def=effctivepartitions, deps=[dataset_partitions_test, code_partitions_test])
def execution_test(context):
  return dg.MaterializeResult()

defs = dg.Definitions(
    assets=[dataset_partitions_test, code_partitions_test, execution_test],
)

Dagster version

dagster, version 1.13.10

Deployment type

None

Deployment details

K8S, Helm

Additional information

No response

Message from the maintainers

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions