Skip to content

Commit

Permalink
fix(serialization): serialize both name, uri and group for Asset
Browse files Browse the repository at this point in the history
  • Loading branch information
Lee-W committed Nov 7, 2024
1 parent 7097961 commit 32394ac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions airflow/serialization/serialized_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ def encode_asset_condition(var: BaseAsset) -> dict[str, Any]:
:meta private:
"""
if isinstance(var, Asset):
return {"__type": DAT.ASSET, "uri": var.uri, "extra": var.extra}
return {"__type": DAT.ASSET, "name": var.name, "uri": var.uri, "group": var.group, "extra": var.extra}
if isinstance(var, AssetAlias):
return {"__type": DAT.ASSET_ALIAS, "name": var.name}
if isinstance(var, AssetAll):
Expand All @@ -272,7 +272,7 @@ def decode_asset_condition(var: dict[str, Any]) -> BaseAsset:
"""
dat = var["__type"]
if dat == DAT.ASSET:
return Asset(var["uri"], extra=var["extra"])
return Asset(uri=var["uri"], name=var["name"], group=var["group"], erxtra=var["extra"])
if dat == DAT.ASSET_ALL:
return AssetAll(*(decode_asset_condition(x) for x in var["objects"]))
if dat == DAT.ASSET_ANY:
Expand Down

0 comments on commit 32394ac

Please sign in to comment.