Taragolis commented on issue #26130:
URL: https://github.com/apache/airflow/issues/26130#issuecomment-1235679224
> But this does not mean we cannot removed cattrs as required Airlfow
dependency.
Sure. I don't think `cattrs` need actually for ser/deser. Some simple
snippet show that it could be archived by `attrs`
```python
import attr
from airflow.utils.module_loading import import_string
from airflow.models.baseoperator import BaseOperatorLink
operator_links_source = {
'airflow.providers.google.cloud.operators.bigquery.BigQueryConsoleIndexableLink':
{
'index': 0
},
'airflow.operators.trigger_dagrun.TriggerDagRunLink': {}
}
for link_class, link_kwargs in operator_links_source.items():
# Ser
klass = attr.make_class(
link_class.rsplit(".")[-1],
[],
bases=(import_string(link_class), )
)
assert issubclass(klass, BaseOperatorLink)
link = klass(**link_kwargs)
# DeSer
dotted_class = f"{klass.__module__}.{klass.__name__}"
link_dict = attr.asdict(link)
```
--
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]