Code Monkey home page Code Monkey logo

Comments (5)

rubenfonseca avatar rubenfonseca commented on September 14, 2024

Looking at this now

from powertools-lambda-python.

rubenfonseca avatar rubenfonseca commented on September 14, 2024

@troyswanson I need a little more help here. Is this on VSCode? I pasted your code into a file but I can't generate an error message. Can you please give me more information about the setup?

from powertools-lambda-python.

troyswanson avatar troyswanson commented on September 14, 2024

Yes, I'm using VSCode. Here's a screenshot from my computer while hovering over the param_value variable.

Screenshot 2023-12-15 at 9 53 31 AM

The return type for get_parameter is str | dict[Unknown, Unknown] | bytes because the function has the ability to transform the data from SSM into a dict or bytes. However, if you don't specify a transformation, it will just return as a str.

Using the int function on a dict type will always fail, which is why the type checker is throwing the warning.

A fix that I can make in my code would be to use typing.cast to force the type checker to assume the value is a str type, but I believe this can be solved in the Powertools library by overloading the type hints for the get_parameter function depending on what kind of arguments are being passed to it.

from powertools-lambda-python.

rubenfonseca avatar rubenfonseca commented on September 14, 2024

Thank you for the update and for testing the issue locally! It sounds like you've pinpointed the challenge with the SSM provider. However I'm not seeing a simple way of implementing the override, mainly due to it being very specific to the SSM provider.

If you have a clear direction in mind for a solution, we'd greatly appreciate your contribution. Please feel free to open a pull request, and we can collaborate to refine the implementation and get it ready for merging. Looking forward to seeing your approach and working together on this!

from powertools-lambda-python.

github-actions avatar github-actions commented on September 14, 2024

⚠️COMMENT VISIBILITY 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 tag a team member or open a new issue that references this one.

If you wish to keep having a conversation with other community members under this issue feel free to do so.

from powertools-lambda-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.