Discussions

 View Only
  • 1.  invalid literal for int() with base 10:

    Posted 03-18-2022 09:51
    I am currently building a pipeline that uses a Webhook to make an API call into openweathermap.org and return a daily JSON file with that day's weather conditions. 

    I then sort through the JSON file using some REGEX code to splice out the data that I want, and am attempting to file that data and build new entries in a Weather Table in one of my apps. I've done this same process with a different API call and had no issues. However, I am currently running into a problem when I try inputting the sorted data into my tables fields in the third step. I keep getting the following error.

    invalid literal for int() with base 10: 'WindSpeed'

    I have tried a myriad of different things including changing the table field from numeric, to text, to numeric currency. I have also tried using Jinja to transform my incoming data using {{b.WindSpeed|int}}, {{b.WindSpeed|float}}, {{b.WindSpeed|string}}. 

    Has anyone else had this issue? Or have any other ideas of how to address this?

    ------------------------------
    TVENT Admin
    ------------------------------


  • 2.  RE: invalid literal for int() with base 10:

    Posted 03-21-2022 09:46
    The error message invalid literal for int() with base 10 would seem to indicate that you are passing a string that's not an integer to the int() function . In other words it's either empty, or has a character in it other than a digit.

    ------------------------------
    Paul Peterson
    ------------------------------



  • 3.  RE: invalid literal for int() with base 10:

    Posted 01-31-2023 16:33
    Did you ever find out what the problem was? What was your resolution if you did find a solution?

    ------------------------------
    Russell Hansen
    ------------------------------



  • 4.  RE: invalid literal for int() with base 10:

    Posted 02-06-2023 10:40
    Sounds like you did a query step but didn't use a loop on the results. If you're not using a loop you need to specify the index explicitly:  {{ b[0].windspeed }}

    Hope that helps!

    ------------------------------
    Doug Henning
    ------------------------------



  • 5.  RE: invalid literal for int() with base 10:

    Posted 09-12-2023 14:00

    Thank you, Doug. I was getting this same error on an unrelated Pipeline and your solution was the solution I needed. It just goes to show that specific errors may be indirectly related to a myriad of other issues and a simple fix is all that's needed. We just need to tap into our resources and ask the right questions!

    I'm so grateful for this wealth of community knowledge. 



    ------------------------------
    Barry Dolan
    ------------------------------