Skip to content

fix(parser): add IoT Core registry models to parser.models exports - #8746

Merged
leandrodamascena merged 2 commits into
aws-powertools:developfrom
Manishram-ai:fix/parser-iot-registry-exports
Nov 3, 2026
Merged

leandrodamascena merged 2 commits into
aws-powertools:developfrom
Manishram-ai:fix/parser-iot-registry-exports

Conversation

@Manishram-ai

Copy link
Copy Markdown
Contributor

Issue number:
closes #8742

Summary

Changes

  • Export the six IoT Core registry models (IoTCoreThingEvent, IoTCoreThingTypeEvent, IoTCoreThingTypeAssociationEvent, IoTCoreThingGroupEvent, IoTCoreAddOrRemoveFromThingGroupEvent, IoTCoreAddOrDeleteFromThingGroupEvent) from parser/models/__init__.py, in the TYPE_CHECKING imports, _MODEL_MODULES and __all__, like the other models.
  • Add a case for each of them to tests/functional/parser/test_model_imports.py.
  • Fix CloudwatchLogsModel to CloudWatchLogsModel in docs/utilities/parser.md (the models table and the CloudWatchLogsEnvelope row).

User experience

Before: from aws_lambda_powertools.utilities.parser.models import IoTCoreThingEvent fails, even though the docs list it as a built-in model. The only way in was the parser.models.iot_registry_events submodule.

After: all six import from parser.models like the other built-in models, and the docs use the real class name.

Verification

  • The 18 new test cases fail on develop and pass with this change.
  • tests/functional/parser: 72 passed (Python 3.12).
  • ruff format --check and ruff check on the changed files are clean.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

The six IoT Core registry models were listed as built-in models in the
docs but missing from parser/models/__init__.py, so importing them from
parser.models failed. Also fix the CloudWatchLogsModel spelling in the
parser docs.
@Manishram-ai
Manishram-ai requested a review from a team as a code owner November 2, 2026 17:49
@powertools-for-aws-oss-automation powertools-for-aws-oss-automation Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Nov 2, 2026
@boring-cyborg boring-cyborg Bot added documentation Improvements or additions to documentation tests labels Nov 2, 2026
@boring-cyborg

boring-cyborg Bot commented Nov 2, 2026

Copy link
Copy Markdown

Thanks a lot for your first contribution! Please check out our contributing guidelines and don't hesitate to ask whatever you need.
In the meantime, check out the #python channel on our Powertools for AWS Lambda Discord: Invite link

@leandrodamascena leandrodamascena left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Manishram-ai, confirmed: all six models import from parser.models now, the submodule path still works, and the docs table matches the class name. I'm approving now. This goes out in 3.39.0 in the next couple of days; no rebase needed, and you'll be credited in the release notes.

@sonarqubecloud

sonarqubecloud Bot commented Nov 3, 2026

Copy link
Copy Markdown

@codecov

codecov Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.00%. Comparing base (dfbae7b) to head (9fe74bf).
⚠️ Report is 2 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #8746   +/-   ##
========================================
  Coverage    97.00%   97.00%           
========================================
  Files          321      321           
  Lines        16415    16415           
  Branches      1482     1482           
========================================
  Hits         15924    15924           
  Misses         350      350           
  Partials       141      141           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@leandrodamascena
leandrodamascena merged commit 914923c into aws-powertools:develop Nov 3, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/M Denotes a PR that changes 30-99 lines, ignoring generated files. tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: IoT Core registry models can't be imported from parser.models

2 participants