Closed Avihais12344 closed 3 days ago
Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval.
@Avihais12344 Thanks for raising the issue. I had follow-up questions:
set
break any existing DAGs or workflows expecting a list? I think it would. Wouldn't this be breaking change? set
is consistent across the codebase, particularly in how tags are stored/retrieved?Hello @sunank200, thanks for responding.
It would break existing code expecting tags as list, that's why I wanted to discuss it here. The interface is different from list, but other than that, it would not be too much than different, we can think of it as a unique list. So I think there would not be edge case, as we alreay take the unique items from the tags list.
We can ensure the use of set
accross the codebase by using typing and linters that would enforce the right types. I would also use the collections.abc
type of MutableSet
instead of the builtin set
, to allow any type of set
.
Created a PR for this here.
This issue has been automatically marked as stale because it has been open for 14 days with no response from the author. It will be closed in next 7 days if no further activity occurs from the issue author.
This issue has been closed because it has not received response from the issue author.
Description
Instead of using
list
for holding the tags of a specific dag (as we can see at the docs), I suggest usingset
instead, specificallyMutableSet
for the type hinting, and pythonset
as the default implementation.Use case/motivation
I would want to add multiple tags (even the same ones) faster, without worrying about duplicates, and reduce the memory usage because of it. Also, it's good to check if a certain tag already exists.
Related issues
No response
Are you willing to submit a PR?
Code of Conduct