Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(typing): move more types into TYPE_CHECKING #5088

Merged
merged 1 commit into from
Sep 9, 2024

Conversation

ericbn
Copy link
Contributor

@ericbn ericbn commented Aug 28, 2024

Issue number: #5029

Summary

Changes

Move more types into TYPE_CHECKING.

User experience

Following up issues reported in #5029.

Checklist

If your change doesn't seem to apply, please leave them unchecked.

Is this a breaking change?

RFC issue number:

Checklist:

  • Migration process documented
  • Implement warnings (if it can live side by side)

Acknowledgment

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.

@ericbn ericbn requested a review from a team as a code owner August 28, 2024 01:17
@pull-request-size pull-request-size bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Aug 28, 2024
@ericbn ericbn force-pushed the more_type_checking branch from 4deeecd to 9e49558 Compare August 28, 2024 01:20
@ericbn
Copy link
Contributor Author

ericbn commented Aug 28, 2024

Looking at the changes done as part of #4607, I double checked that this was the only place where we moved a pydantic import to outside TYPE_CHECKING. I see you already fixed this. I'm just trying to improve on top of your fix.

@ericbn ericbn force-pushed the more_type_checking branch from 9e49558 to 681a320 Compare August 28, 2024 01:37
Copy link

@leandrodamascena
Copy link
Contributor

Hi @ericbn! Thanks for opening this PR! I'm planning to review it by Friday.

In the meantime, and if possible, can you please test version 3.0.0.dev10? I mean, maybe install it in some Lambda function and run your local tests or development environment? It would be great to get some feedback on this.

https://pypi.org/project/aws-lambda-powertools/3.0.0.dev10/

Thanks

@ericbn
Copy link
Contributor Author

ericbn commented Aug 28, 2024

@leandrodamascena FYI these are the modules we use in our project:

  • aws_lambda_powertools.event_handler: APIGatewayHttpResolver, Response
  • aws_lambda_powertools.metrics: Metrics, MetricUnit, single_metric
  • aws_lambda_powertools.shared.functions: strtobool
  • aws_lambda_powertools.utilities.batch: BatchProcessor, EventType, process_partial_response
  • aws_lambda_powertools.utilities.data_classes: APIGatewayProxyEvent, APIGatewayProxyEventV2, event_source
  • aws_lambda_powertools.utilities.data_classes.sqs_event: SQSRecord (as type annotation for the code using the batch package)
  • aws_lambda_powertools.utilities.parameters: get_parameter, get_parameters_by_name

I've updated our project to use plain aws-lambda-powertools==3.0.0.dev10 installed in our our shared layer, no other extras, nor any AWSLambdaPowertoolsPythonVX layer. Deployed it to a remote dev environment and all working like a charm!

@leandrodamascena
Copy link
Contributor

@leandrodamascena FYI these are the modules we use in our project:

  • aws_lambda_powertools.event_handler: APIGatewayHttpResolver, Response
  • aws_lambda_powertools.metrics: Metrics, MetricUnit, single_metric
  • aws_lambda_powertools.shared.functions: strtobool
  • aws_lambda_powertools.utilities.batch: BatchProcessor, EventType, process_partial_response
  • aws_lambda_powertools.utilities.data_classes: APIGatewayProxyEvent, APIGatewayProxyEventV2, event_source
  • aws_lambda_powertools.utilities.data_classes.sqs_event: SQSRecord (as type annotation for the code using the batch package)
  • aws_lambda_powertools.utilities.parameters: get_parameter, get_parameters_by_name

I've updated our project to use plain aws-lambda-powertools==3.0.0.dev10 installed in our our shared layer, no other extras, nor any AWSLambdaPowertoolsPythonVX layer. Deployed it to a remote dev environment and all working like a charm!

That's completely amazing to hear @ericbn! Thanks a lot for testing this! ❤️

@leandrodamascena leandrodamascena self-requested a review August 29, 2024 10:50
@leandrodamascena leandrodamascena linked an issue Aug 29, 2024 that may be closed by this pull request
@leandrodamascena
Copy link
Contributor

Hi @ericbn! Sorry for the delay, but I had to travel for some internal meetings and I'm returning tomorrow and will finish this review this week.

Thanks

Copy link
Contributor

@leandrodamascena leandrodamascena left a comment

Choose a reason for hiding this comment

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

APPROVED! Thanks @ericbn! 🚀

@leandrodamascena leandrodamascena merged commit 581fef3 into aws-powertools:v3 Sep 9, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
event_handlers size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Revert changes that impacts v3
2 participants