Skip to content

Conversation

@valerena
Copy link
Contributor

Allow the transform to be used in Python3.14, except GraphQLApi and Capacity Providers functionalities.

make pr still doesn't work, but the transform can be used successfully in Python 3.14 (if not using the above features)

bin/sam-translate.py --template ./template.yaml

Issue #, if available

#3831

Description of changes

Add a try/except when importing the model classes. These classes are only used for Capacity Provider and GraphQLApi, so those items are still not supported when using Python3.14. But at least for now the rest of the transform works correctly.

I also removed a variable resource_property_schema that was being initialized for the Lambda Capacity Provider class definition, but it never changed value and it was used only once. So I replaced it with the value imported directly instead of saving it in an intermediate variable.

I also updated jsonschema version because the previous version wasn't supported in python3.14. I also removed cloudformation-cli from dev dependencies, because it doesn't support latest versions of Python (and it's not actually used for anything)

Description of how you validated changes

Manual tests
make pr is still failing, because of course all the Capacity Provider and GraphQLApi tests that now are not working. And also a couple of other tests that import the model too, that are failing with pydantic v1. That's one of the reasons why we can't count python3.14 as really "supported" yet.

Checklist

Examples?

Please reach out in the comments if you want to add an example. Examples will be
added to sam init through aws/aws-sam-cli-app-templates.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Allow the transform to be used in Python3.14, except GraphQLApi and
Capacity Providers functionalities.

`make pr` still doesn't work, but the transform can be used successfully
in Python 3.14 (if not using the above features)

```
bin/sam-translate.py --template ./template.yaml
```
@valerena valerena requested a review from a team as a code owner December 12, 2025 02:18
roger-zhangg
roger-zhangg previously approved these changes Dec 12, 2025
Copy link
Member

@roger-zhangg roger-zhangg left a comment

Choose a reason for hiding this comment

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

LGTM

tobixlea
tobixlea previously approved these changes Dec 12, 2025
aws_serverless_function,
aws_serverless_graphqlapi,
)
except Exception:
Copy link
Member

Choose a reason for hiding this comment

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

small thing

Suggested change
except Exception:
except ImportError:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually I tried this initially, but the exception here is not an ImportError. It's not that the library doesn't exist.. This actually just sends a RuntimeException coming from somewhere in pydantic code. And at that point I imagined that it's not really relevant where the exception came from.

@valerena valerena dismissed stale reviews from tobixlea and roger-zhangg via 8066b14 December 12, 2025 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants