You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code shown in this section appears to be checking that the code isn't running locally? if 'SERVERTYPE' in os.environ and os.environ['SERVERTYPE'] == 'AWS Lambda':
appears to be a check that the code is running in Lambda, when it should fully inverted as far as I can tell? I'm happy to fix this myself, I just want to ensure I am correctly interpreting what's happening here.
Expected Behavior
N/A
Actual Behavior
N/A
Possible Fix
not the if
Steps to Reproduce
N/A
Your Environment
N/A
The text was updated successfully, but these errors were encountered:
Hey @texonidas, thanks for the report. I agree with you - this code example in the README doesn't make sense to me. In addition to the issue you pointed out, in the very next line it calls import os, but the os module would clearly have to been already imported since the line before is already using os.environ... 🙄
Unfortunately, this portion of the README is 6 years old, so I have no idea what the original author was thinking. But, I'm convinced it should be changed, so I will be altering that line to provide an example of the modern canonical check for whether code is running in the Lambda runtime environment or not. Hope that will clear things up for everyone!
Context
The code shown in this section appears to be checking that the code isn't running locally?
if 'SERVERTYPE' in os.environ and os.environ['SERVERTYPE'] == 'AWS Lambda':
appears to be a check that the code is running in Lambda, when it should fully inverted as far as I can tell? I'm happy to fix this myself, I just want to ensure I am correctly interpreting what's happening here.
Expected Behavior
N/A
Actual Behavior
N/A
Possible Fix
not
the ifSteps to Reproduce
N/A
Your Environment
N/A
The text was updated successfully, but these errors were encountered: