Skip to content

returned value regression in 2.5.8 #1017

Open
@fmigneault

Description

@fmigneault

Steps to reproduce

This is similar to #1007, but for basic dict returned from a custom class method.
I have tried with astroid 2.5.6, 2.5.7 and 2.5.8. The issue only is visible in 2.5.8.

Code snippet that triggers (full code here):

filters = {**request.params, "process": process, "provider": service}
filters = sd.GetJobsQueries().deserialize(filters)
detail = filters.pop("detail", False)

The GetJobsQueries is a colander schema that essentially validates the provided data and generates the dictionary as output.

Current behavior

Following is raised

weaver/wps_restapi/jobs/jobs.py:229:17: E1101: Instance of 'ExtendedSchemaNode' has no 'pop' member (no-member)
weaver/wps_restapi/jobs/jobs.py:229:91: E1101: Instance of 'ExtendedSchemaNode' has no 'pop' member (no-member)
weaver/wps_restapi/jobs/jobs.py:237:29: E1101: Instance of 'ExtendedSchemaNode' has no 'pop' member (no-member)
weaver/wps_restapi/jobs/jobs.py:251:75: E1134: Non-mapping value filters is used in a mapping context (not-a-mapping)

Error output logs:
https://github.com/crim-ca/weaver/runs/2776250383?check_suite_focus=true#step:8:295

Expected behavior

In versions 2.5.7 and before, no error was returned.
There are many tests in the above referenced test-suite that validate that a dictionary is indeed returned by .deserialize() and that it correctly does what is expected.
It seems the resolution of the class instance (and derived base classes?) produces an invalid "return value" as an instance of the class itself that triggers pylint afterwards.

Following test suite demonstrates that pin of the version astroid<2.5.8 works again as expected:
https://github.com/crim-ca/weaver/runs/2776481262#step:8:544

python -c "from astroid import __pkginfo__; print(__pkginfo__.version)" output

versions 2.5.6, 2.5.7, 2.5.8 according to evaluated combinations

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions