Skip to content

"Collection" module issue for python version 3.11 #707

@saurabhPatilCybage

Description

@saurabhPatilCybage

Error:

AttributeError: module 'collections' has no attribute 'Mapping'
Error Path: -facebook_business\api.py", line 885, in _top_level_param_json_encode isinstance(value, (collections_abc.Mapping, collections_abc.Sequence, bool))

Reason:

In Python 3.10 and later, 'Mapping' has been moved from 'collections' to 'collections.abc'.

Solution:

Update any code importing 'Mapping' from 'collections' to import it from 'collections.abc' instead.

Fix:

Error: - from collections import Mapping
Right: - from collections.abc import Mapping

fields = ['name', 'account_status']
params = {}
acc_details = AdAccount(client_adaccount).api_get(fields=fields, params=params)

Pull Request link: - #706

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions