Commit 274705b
committed
[core] Fix AssetCheckKey.from_user_string for asset keys containing colons
AssetCheckKey.to_user_string() renders a check key as
"<asset_key>:<check_name>", but from_user_string() split on every colon and
unpacked into exactly two values. Asset keys can legitimately contain colons
(for example the dagster-looker integration emits keys such as
["my_model::my_explore"]), so such a key raised
"ValueError: too many values to unpack (expected 2)" when parsed back.
This surfaces in the freshness-check sensor, which stores a check key via
to_user_string() as its cursor and reads it back with from_user_string() on
the next tick; a colon-containing asset key makes every subsequent tick fail.
Split off only the trailing ":<name>" segment with rsplit(":", 1). The check
name is a plain identifier, so the last segment is unambiguous, and colon-free
keys are parsed exactly as before.1 parent b548e05 commit 274705b
2 files changed
Lines changed: 21 additions & 1 deletion
File tree
- python_modules/dagster
- dagster_tests/definitions_tests
- dagster/_core/definitions
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
233 | | - | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
234 | 238 | | |
235 | 239 | | |
236 | 240 | | |
| |||
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
53 | 69 | | |
54 | 70 | | |
55 | 71 | | |
| |||
0 commit comments