Make pushsource compatible with attrs version 22.2.0 #295
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Since the attrs version release, pub tests have begun failing with the error "TypeError: keywords must be strings". Attrs have added an "alias" parameter to each attribute[1], which is used in the attrs's "evolve" method to construct a new instance. This causes issues with the attribute "from", which has some special logic implemented in order to be usable at all[2]. The attribute "from" is generated from "from_", copying all its parameters. Since "alias" is a new parameter, it isn't copied and thus its value is set no "None". attrs's "evolve" method uses **kwargs to create a new instance, and it sets one of the keys in **kwargs to "None" (from alias). Keys in **kwargs must be strings, which causes the TypeError. It can be fixed by also setting "alias" in the newly created "from" attribute. In case of "from_", it has the same value as "name" parameter ("from_"), which is why we don't want to copy it from the old attribute, but explicitly set it to "from" (otherwise it would be "from_"). The change should be backwards compatible with older versions of attrs.
[1] python-attrs/attrs#950
[2] #108
Refers to CLOUDDST-17044