New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix defaulting of parameters in explicitly specified deps on parametrize
d targets for AsyncFieldMixin
#16176
Merged
stuhood
merged 2 commits into
pantsbuild:main
from
stuhood:stuhood/parametrization-in-explicit-deps-fix
Jul 14, 2022
Merged
Fix defaulting of parameters in explicitly specified deps on parametrize
d targets for AsyncFieldMixin
#16176
stuhood
merged 2 commits into
pantsbuild:main
from
stuhood:stuhood/parametrization-in-explicit-deps-fix
Jul 14, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Rust tests and lints will be skipped. Delete if not intended. [ci skip-rust] # Building wheels and fs_util will be skipped. Delete if not intended. [ci skip-build-wheels]
[ci skip-rust] [ci skip-build-wheels]
stuhood
commented
Jul 14, 2022
unspecified_param_field_names = { | ||
key for key in candidate.address.parameters.keys() if key not in address.parameters | ||
} | ||
|
||
return all( | ||
consumer.has_field(field_type) and consumer[field_type] == field_value | ||
for field_type, field_value in candidate.field_values.items() | ||
consumer.has_field(field_type) and consumer[field_type].value == field.value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the actual fix, and the addition of AsyncFieldMixin
to the mock ResolveField
in the test is the validation.
tdyas
approved these changes
Jul 14, 2022
Thanks for the quick fix! |
stuhood
added a commit
to stuhood/pants
that referenced
this pull request
Jul 14, 2022
…rize`d targets for AsyncFieldMixin (pantsbuild#16176) Although the tests for pantsbuild#14519 were reasonably good, they tested with `StringField`, rather than additionally with `AsyncFieldMixin`. The latter changes the definition of equality for the `Field` to include its address, meaning that comparing the `Field` instance itself will never match for `Field`s from different targets. That made pantsbuild#14519... not particularly useful in production. This change fixes `Field` value comparisons to use `field.value`, references the newly opened pantsbuild#16175 (which is out of scope for now, given that it will likely be impacted by `__defaults__` and would be much harder to cherry-pick), and adds an additional test. Fixes pantsbuild#14519. [ci skip-rust] [ci skip-build-wheels]
stuhood
added a commit
to stuhood/pants
that referenced
this pull request
Jul 14, 2022
…rize`d targets for AsyncFieldMixin (pantsbuild#16176) Although the tests for pantsbuild#14519 were reasonably good, they tested with `StringField`, rather than additionally with `AsyncFieldMixin`. The latter changes the definition of equality for the `Field` to include its address, meaning that comparing the `Field` instance itself will never match for `Field`s from different targets. That made pantsbuild#14519... not particularly useful in production. This change fixes `Field` value comparisons to use `field.value`, references the newly opened pantsbuild#16175 (which is out of scope for now, given that it will likely be impacted by `__defaults__` and would be much harder to cherry-pick), and adds an additional test. Fixes pantsbuild#14519. [ci skip-rust] [ci skip-build-wheels]
stuhood
added a commit
that referenced
this pull request
Jul 14, 2022
…rize`d targets for AsyncFieldMixin (Cherry-pick of #16176) (#16180) Although the tests for #14519 were reasonably good, they tested with `StringField`, rather than additionally with `AsyncFieldMixin`. The latter changes the definition of equality for the `Field` to include its address, meaning that comparing the `Field` instance itself will never match for `Field`s from different targets. That made #14519... not particularly useful in production. This change fixes `Field` value comparisons to use `field.value`, references the newly opened #16175 (which is out of scope for now, given that it will likely be impacted by `__defaults__` and would be much harder to cherry-pick), and adds an additional test. Fixes #14519. [ci skip-rust] [ci skip-build-wheels]
stuhood
added a commit
that referenced
this pull request
Jul 14, 2022
…rize`d targets for AsyncFieldMixin (Cherry-pick of #16176) (#16179) Although the tests for #14519 were reasonably good, they tested with `StringField`, rather than additionally with `AsyncFieldMixin`. The latter changes the definition of equality for the `Field` to include its address, meaning that comparing the `Field` instance itself will never match for `Field`s from different targets. That made #14519... not particularly useful in production. This change fixes `Field` value comparisons to use `field.value`, references the newly opened #16175 (which is out of scope for now, given that it will likely be impacted by `__defaults__` and would be much harder to cherry-pick), and adds an additional test. Fixes #14519. [ci skip-rust] [ci skip-build-wheels]
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Although the tests for #14519 were reasonably good, they tested with
StringField
, rather than additionally withAsyncFieldMixin
. The latter changes the definition of equality for theField
to include its address, meaning that comparing theField
instance itself will never match forField
s from different targets. That made #14519... not particularly useful in production.This change fixes
Field
value comparisons to usefield.value
, references the newly opened #16175 (which is out of scope for now, given that it will likely be impacted by__defaults__
and would be much harder to cherry-pick), and adds an additional test.Fixes #14519.
[ci skip-rust]
[ci skip-build-wheels]