Skip to content

Add preview warning for Python 3.15#209

Merged
Stefan9283 merged 1 commit into
mainfrom
stefantm/preview-warning
Jun 22, 2026
Merged

Add preview warning for Python 3.15#209
Stefan9283 merged 1 commit into
mainfrom
stefantm/preview-warning

Conversation

@Stefan9283

Copy link
Copy Markdown
Contributor

Issue #, if available: none

Description of changes: This change adds a message meant to warn that the Lambda function is running on top of a preview runtime. The message can be disabled via the env variable LAMBDA_DISABLE_PREVIEW_WARN

Target (OCI, Managed Runtime, both): both

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

@Stefan9283 Stefan9283 force-pushed the stefantm/preview-warning branch from 545540e to 97e778f Compare June 22, 2026 15:15
@Stefan9283 Stefan9283 force-pushed the stefantm/preview-warning branch from 97e778f to 2068ac0 Compare June 22, 2026 15:27
Comment thread awslambdaric/bootstrap.py
if os.environ.get("LAMBDA_DISABLE_PREVIEW_WARN", ""):
return

from .lambda_literals import get_lambda_preview_runtime_warning_message

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Just out of curiosity. Why don't you import it at top-level? Thats because it's a performance stuff and lazy loading is better?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yup, I'm avoiding the tiny performance hit of the lazy loaded import by returning earlier

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nice, that make sense.

@darklight3it darklight3it left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM 🚀

@Stefan9283 Stefan9283 merged commit 3c864c8 into main Jun 22, 2026
36 checks passed
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.

4 participants