Repository navigation
Conversation
|
No acknowledgement section found. Please make sure you used the template to open a PR and didn't remove the acknowledgment section. Check the template at |
|
Contributor
|
Thanks @azmi2409, the change is correct, but @Manishram-ai reported this and asked to send the fix before this PR opened, and their #8746 is up now. We go with whoever claimed the issue first, so I'm closing this one. Sorry for the wasted effort; the Logger audit in #8730 will turn into issues this week if you want another one. |
This file contains hidden or 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
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.



closes #8742
Summary
Changes
aws_lambda_powertools.utilities.parser.models, following the existing lazy-loading pattern inparser/models/__init__.py(TYPE_CHECKING import,_MODEL_MODULESmapping, and__all__):IoTCoreThingEvent,IoTCoreThingTypeEvent,IoTCoreThingTypeAssociationEvent,IoTCoreThingGroupEvent,IoTCoreAddOrRemoveFromThingGroupEvent, andIoTCoreAddOrDeleteFromThingGroupEvent.tests/functional/parser/test_model_imports.py, asserting the export, submodule, and attribute access paths all resolve and load only theiot_registry_eventsmodule.CloudwatchLogsModelspelling indocs/utilities/parser.md(built-in models table and theCloudWatchLogsEnveloperow) toCloudWatchLogsModel, matching the actual class name.User experience
Before:
from aws_lambda_powertools.utilities.parser.models import IoTCoreThingEventraisedImportError, even though the Parser docs listed the six models as built-in models; importing from theparser.models.iot_registry_eventssubmodule was the only workaround. The docs table also listed aCloudwatchLogsModelname that does not exist.After: all six models import from
aws_lambda_powertools.utilities.parser.modelslike the other built-in models, and the docs table spellsCloudWatchLogsModelcorrectly.Verification
ImportError: cannot import name 'IoTCoreThingEvent'andImportError: cannot import name 'CloudwatchLogsModel'(with Python suggestingCloudWatchLogsModel). After the fix, all six models plusCloudWatchLogsModelimport fromparser.models, including viafrom ... import *.IoTCoreThingEventexport test fails ondevelop(without the fix) with the sameAttributeErrorreported in the issue, and passes with the fix.tests/functional/parser/test_model_imports.py: 42 passed.tests/functional/parser/(full suite): 72 passed.ruff format --checkandruff checkon both changed Python files: clean.