Conversation
📝 WalkthroughWalkthroughModel attribute-mapping/storage now uses prepared mapped keys and copies mappings to avoid external mutation; Model respects class descriptors when setting attributes. The Parameter resource adds a class attribute mapping and multiple property accessors (including Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Caution Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional.
❌ Failed checks (1 error)
✅ Passed checks (2 passed)
Comment |
b4f0443 to
b2a8184
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
tests/unit/resources/catalog/test_parameter_properties.py (1)
4-4: Remove invalid# noqa: WPS218directives.Ruff does not recognize
WPS218(a wemake-python-styleguide rule). Since this project uses Ruff for linting, these directives have no effect and should be removed.♻️ Proposed fix
-def test_parameter_properties_getters(): # noqa: WPS218 +def test_parameter_properties_getters():-def test_parameter_properties_setters(): # noqa: WPS218 +def test_parameter_properties_setters():-def test_parameter_default_values(): # noqa: WPS218 +def test_parameter_default_values():Also applies to: 32-32, 64-64
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@tests/unit/resources/catalog/test_parameter_properties.py` at line 4, Remove the invalid Ruff-ignore directives by deleting the `# noqa: WPS218` comment from the test function declaration `test_parameter_properties_getters` (and the two other occurrences flagged in the same file), since Ruff does not recognize `WPS218`; simply remove the `# noqa: WPS218` tokens so the function defs are clean (e.g., change `def test_parameter_properties_getters(): # noqa: WPS218` to `def test_parameter_properties_getters():`) and repeat for the other two occurrences.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@tests/unit/resources/catalog/test_parameter_properties.py`:
- Around line 58-61: The test contains duplicate assertions on result_dict
("scope" == "Agreement" and "externalId" == "ext-2") in
test_parameter_properties.py; remove the repeated assertions so each check for
result_dict["scope"] and result_dict["externalId"] appears only once, leaving a
single pair of asserts referencing result_dict to avoid redundant assertions.
- Line 37: Add an explicit property for type_ on the Parameter class consistent
with the other parameter attributes: implement a `@property` def type_(self) that
returns self._box.type_ (or getattr(self._box, "type_", None)) and a setter def
type_(self, value) that sets self._box.type_ = value (or uses setattr) and
mirrors any validation/behavior used by other properties like scope/phase;
update the Parameter class to include these getter and setter methods so type_
is treated the same way as scope, phase, context, options, multiple,
constraints, group, external_id, and status.
---
Nitpick comments:
In `@tests/unit/resources/catalog/test_parameter_properties.py`:
- Line 4: Remove the invalid Ruff-ignore directives by deleting the `# noqa:
WPS218` comment from the test function declaration
`test_parameter_properties_getters` (and the two other occurrences flagged in
the same file), since Ruff does not recognize `WPS218`; simply remove the `#
noqa: WPS218` tokens so the function defs are clean (e.g., change `def
test_parameter_properties_getters(): # noqa: WPS218` to `def
test_parameter_properties_getters():`) and repeat for the other two occurrences.
| assert result_dict["scope"] == "Agreement" | ||
| assert result_dict["externalId"] == "ext-2" | ||
| assert result_dict["scope"] == "Agreement" | ||
| assert result_dict["externalId"] == "ext-2" |
There was a problem hiding this comment.
Remove duplicate assertions.
Lines 60-61 are exact duplicates of lines 58-59. This appears to be a copy-paste error.
🧹 Proposed fix
result_dict = result.to_dict()
assert result_dict["scope"] == "Agreement"
assert result_dict["externalId"] == "ext-2"
- assert result_dict["scope"] == "Agreement"
- assert result_dict["externalId"] == "ext-2"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| assert result_dict["scope"] == "Agreement" | |
| assert result_dict["externalId"] == "ext-2" | |
| assert result_dict["scope"] == "Agreement" | |
| assert result_dict["externalId"] == "ext-2" | |
| assert result_dict["scope"] == "Agreement" | |
| assert result_dict["externalId"] == "ext-2" |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@tests/unit/resources/catalog/test_parameter_properties.py` around lines 58 -
61, The test contains duplicate assertions on result_dict ("scope" ==
"Agreement" and "externalId" == "ext-2") in test_parameter_properties.py; remove
the repeated assertions so each check for result_dict["scope"] and
result_dict["externalId"] appears only once, leaving a single pair of asserts
referencing result_dict to avoid redundant assertions.
b2a8184 to
b256d60
Compare
|
There was a problem hiding this comment.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In `@tests/unit/resources/catalog/test_parameter_properties.py`:
- Around line 32-61: The test test_parameter_properties_setters contains
duplicated assertions checking result_dict["scope"] and
result_dict["externalId"]; remove the redundant second pair so only one
assertion for each key remains (locate the assertions after result_dict =
result.to_dict() and delete the duplicated lines asserting "scope" and
"externalId").



Parameter Model Improvements