Skip to content

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

Closed

Description

@Manishram-ai

Expected Behaviour

The six IoT Core registry models listed under "Built-in models" in the Parser docs can be imported from aws_lambda_powertools.utilities.parser.models, like the other built-in models.

Current Behaviour

They're missing from parser/models/__init__.py, so the import fails:

ImportError: cannot import name 'IoTCoreThingEvent' from 'aws_lambda_powertools.utilities.parser.models'

The same happens for IoTCoreThingTypeEvent, IoTCoreThingTypeAssociationEvent, IoTCoreThingGroupEvent, IoTCoreAddOrRemoveFromThingGroupEvent and IoTCoreAddOrDeleteFromThingGroupEvent. Importing them from the submodule (parser.models.iot_registry_events) works.

A small related one in the same docs table: it lists CloudwatchLogsModel, but the class is CloudWatchLogsModel, so that import fails too. The CloudWatchLogsEnvelope row uses the same spelling.

Code snippet

from aws_lambda_powertools.utilities.parser.models import IoTCoreThingEvent

Possible Solution

Export the six models from parser/models/__init__.py the same way as the other models, add a case to tests/functional/parser/test_model_imports.py, and fix the CloudwatchLogsModel spelling in docs/utilities/parser.md. I'm happy to send a PR for this.

Steps to Reproduce

  1. pip install "aws-lambda-powertools[parser]==3.38.0"
  2. Run the snippet above.

Powertools for AWS Lambda (Python) version

3.38.0

AWS Lambda function runtime

3.10 (ran locally)

Packaging format used

PyPi

Debugging logs

No response

Activity

  1. boring-cyborg commented on Nov 1, 2026

    @boring-cyborg

    Thanks for opening your first issue here! We'll come back to you as soon as we can.
    In the meantime, check out the #python channel on our Powertools for AWS Lambda Discord: Invite link

  2. powertools-for-aws-oss-automation commented on Nov 1, 2026

    @powertools-for-aws-oss-automation

    Thanks for opening your first issue here! We'll come back to you as soon as we can.
    In the meantime, check out our GitHub Discussions: Join the conversation

  3. leandrodamascena commented on Nov 2, 2026

    @leandrodamascena
    Contributor

    Thanks @Manishram-ai, confirmed on develop: the six IoT Core models were never added to parser/models/__init__.py, so only the submodule import works, and the docs table has CloudwatchLogsModel twice where the class is CloudWatchLogsModel. Your plan is the right one, including the new cases in test_model_imports.py. Do you want to send the PR? Say so here and I'll assign the issue to you. This goes into 3.39.0, which ships in two days, so if you can open it in the next day it makes the cut.

  4. added this to the 3.39.0 milestone on Nov 2, 2026
  5. Manishram-ai commented on Nov 2, 2026

    @Manishram-ai
    ContributorAuthor

    Yes, I'd like to send it. I'll open the PR today.

  6. powertools-for-aws-oss-automation commented on Nov 3, 2026

    @powertools-for-aws-oss-automation

    Warning

    This issue is now closed. Please be mindful that future comments are hard for our team to see.
    If you need more assistance, please either reopen the issue, or open a new issue referencing this one.
    If you wish to keep having a conversation with other community members under this issue feel free to do so.

  7. github-actions commented on Nov 3, 2026

    @github-actions
    Contributor

    This is now released under 3.39.0 version!

  8. removed
    pending-releaseFix or implementation already in dev waiting to be released
    on Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinggood first issueGood for newcomersparserParser (Pydantic) utility

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions