Python pylint errors for intrinsic function calls after upgrading to v1.19.0
After upgrading to CDK v1.19.0 for Python, pylint is throwing "no value for argument in unbound method call" errors for aws_cdk.core Fn intrinsic functions calls. CDK can still synth and deploy my code despite the errors, but this does not happen when running CDK v1.18.0
Was there a change in the Fn intrinsic functions in CDK v1.19.0?
Reproduction Steps
- Upgrade CDK CLI to v1.19.0
- Upgrade Python CDK modules to v1.19.0
- Call a Fn intrinsic function in code
- Execute pylint on .py file
Example code using Fn.import_value from aws_cdk.core:
from aws_cdk import core
VPC_SUBNET = core.Fn.import_value("oPrivateSubnetA")
Error Log
(.env) PS C:\Development\pwc-tools\pwc_tools> pylint --disable="R,C,W" pwc_tools_stack.py
************* Module pwc_tools.pwc_tools_stack
pwc_tools_stack.py:44:28: E1120: No value for argument 'shared_value_to_import' in unbound method call (no-value-for-parameter)
------------------------------------------------------------------
Your code has been rated at 5.83/10 (previous run: 5.00/10, +0.83)
If shared_value_to_import or whichever respective argument is named in the function call like such
from aws_cdk import core
VPC_SUBNET = core.Fn.import_value(shared_value_to_import="oPrivateSubnetA")
pylint will report that argument cls has no value, but will still successfully synth and deploy
(.env) PS C:\Development\pwc-tools\pwc_tools> pylint --disable="R,C,W" .\pwc_tools_stack.py
************* Module pwc_tools.pwc_tools_stack
pwc_tools_stack.py:44:28: E1120: No value for argument 'cls' in unbound method call (no-value-for-parameter)
------------------------------------------------------------------
Your code has been rated at 5.83/10 (previous run: 5.83/10, +0.00)
Environment
- CLI Version : 1.19.0
- Framework Version: 1.19.0
- OS : Windows 10
- Language : Python
Other
This is :bug: Bug Report
I'm seeing this also and no guidance on what to do. I've also seen this in the route53 module for recordAlias.from_alias in 1.19.0 and today with 1.20.0.
I'm still seeing this in 1.20.0 as well. No issues deploying my code though
Also seeing this for secrets (Secret.from_secret_arn)
The same issue for lambda function - Code.from_asset, for core.Tag.add, and for iam role - from_aws_managed_policy_name. cdk 1.21.1, pylint for vscode
I'm seeing this as well on ec2. CDK v1.32.2 pylint v2.4.2 python v3.7.4 vscode 1.44.1
This is likely due to an update in MyPY that started checking things it didn't previously check.
I actually think this is the same problem as the one reported in #6148.
JSII issue - closing.
⚠️COMMENT VISIBILITY WARNING⚠️
Comments on closed issues 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.