Skip to content

Commit

Permalink
Revert "throw error for empty asset key (#8069)" (#8093)
Browse files Browse the repository at this point in the history
This reverts commit ac6007c. Some users still have rows with this property in their DBs, and these assets are now raising errors when the asset catalog is loaded.

We should also watch out for breaking changes to customers' existing write paths, although that one is more open to debate since its invalid data.
  • Loading branch information
gibsondan committed May 27, 2022
1 parent d980112 commit f733499
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 13 deletions.
3 changes: 0 additions & 3 deletions python_modules/dagster/dagster/core/definitions/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,6 @@ def __new__(cls, path: Sequence[str]):
else:
path = list(check.sequence_param(path, "path", of_type=str))

check.invariant(
all(len(seg) > 0 for seg in path), "Asset key segments must be non-empty strings."
)
return super(AssetKey, cls).__new__(cls, path=path)

def __str__(self):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import pytest

from dagster import AssetKey, AssetMaterialization, Output, job, op
from dagster._check import CheckError
from dagster.core.definitions.events import parse_asset_key_string
from dagster.core.events.log import EventLogEntry
from dagster.core.instance import DagsterInstance, InstanceRef
Expand All @@ -10,13 +7,6 @@
from dagster.utils.test import copy_directory


def test_invalid_asset_key():
with pytest.raises(CheckError):
AssetKey("")
with pytest.raises(CheckError):
AssetKey(["foo", "", "bar"])


def test_structured_asset_key():
asset_parsed = AssetKey(parse_asset_key_string("(Hello)"))
assert len(asset_parsed.path) == 1
Expand Down

0 comments on commit f733499

Please sign in to comment.