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
error running target-csv on a python version >=3.10.
Enviroment:
output of uname -a: Linux 41bfd29a1839 5.15.49-linuxkit #1 SMP PREEMPT Tue Sep 13 07:51:32 UTC 2022 aarch64 GNU/Linux
output of python -V Python 3.11.1
i'm working with docker hub image: python:3.11-slim
Problem
Starting from python 3.10, MutableMapping was moved under collections.abc .
See: Deprecated since version 3.3, will be removed in version 3.10: Moved [Collections Abstract Base Classes](https://docs.python.org/3.9/library/collections.abc.html#collections-abstract-base-classes) to the [collections.abc](https://docs.python.org/3.9/library/collections.abc.html#module-collections.abc) module. For backwards compatibility, they continue to be visible in this module through Python 3.9.
I am running on Python 3.10.9. with a modified target_csv.py modified with
from collections.abc import MutableMapping
and the updated function
def flatten(d, parent_key='', sep='__'):
items = []
for k, v in d.items():
new_key = parent_key + sep + k if parent_key else k
if isinstance(v, MutableMapping):
items.extend(flatten(v, new_key, sep=sep).items())
else:
items.append((new_key, str(v) if type(v) is list else v))
return dict(items)
Description
error running target-csv on a python version >=3.10.
Enviroment:
output of uname -a:
Linux 41bfd29a1839 5.15.49-linuxkit #1 SMP PREEMPT Tue Sep 13 07:51:32 UTC 2022 aarch64 GNU/Linux
output of python -V
Python 3.11.1
i'm working with docker hub image: python:3.11-slim
Problem
Starting from python 3.10, MutableMapping was moved under collections.abc .
See:
Deprecated since version 3.3, will be removed in version 3.10: Moved [Collections Abstract Base Classes](https://docs.python.org/3.9/library/collections.abc.html#collections-abstract-base-classes) to the [collections.abc](https://docs.python.org/3.9/library/collections.abc.html#module-collections.abc) module. For backwards compatibility, they continue to be visible in this module through Python 3.9.
Reference: https://docs.python.org/3.9/library/collections.html
The text was updated successfully, but these errors were encountered: