Lee-W commented on code in PR #44791:
URL: https://github.com/apache/airflow/pull/44791#discussion_r1877035602
##########
airflow/datasets/metadata.py:
##########
@@ -38,9 +39,26 @@ class Metadata:
def __init__(
self, target: str | Dataset, extra: dict[str, Any], alias:
DatasetAlias | str | None = None
) -> None:
+ if isinstance(target, str):
+ warnings.warn(
+ (
+ "Accessing outlet_events using string is deprecated and
will be removed in Airflow 3. "
+ "Please use the Dataset or DatasetAlias object (renamed as
Asset and AssetAlias in Airflow 3) directly"
+ ),
+ DeprecationWarning,
+ stacklevel=2,
+ )
self.uri = extract_event_key(target)
self.extra = extra
if isinstance(alias, DatasetAlias):
self.alias_name = alias.name
else:
+ warnings.warn(
+ (
+ "Emitting dataset events using string is deprecated and
will be removed in Airflow 3. "
+ "Please use the Dataset object (renamed as Asset in
Airflow 3) directly"
+ ),
+ DeprecationWarning,
+ stacklevel=2,
+ )
Review Comment:
I would probably vote for no. as we're not supporting string for
`outlet_events[...]`, it might be better for us to use it consistently here and
the problem of supporting string there is that could be an asset or an alias
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]