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
I use some code to change field_names with regex but when the pipeline contains the steps for more than 87 fields I get this error I don't understand:
frictionless.exception.FrictionlessException: [step-error] Step is not valid: "field_update" raises "maximum recursion depth exceeded
in instancecheck"
Here is my code:
from re import search
from os import remove
from frictionless import Resource, steps, formats, Schema, Pipeline,transform
source = Resource(path="reponse_3.csv")
schema = Schema.describe("reponse_3.csv")
field_names=schema.field_names
step_list=[]
def remove_number(field_name):
match = search(r'\d+\.\s(.+)', field_name)
if match:
return match.group(1)
else:
return field_name
for field_name in field_names:
step_list.append(steps.field_update(name=field_name, descriptor={"name":remove_number(field_name)}))
pipeline = Pipeline(steps=step_list)
target= source.transform(pipeline)
target.write('reponse_3.csv', control=formats.CsvControl(delimiter=';'), encoding='utf-8')
Thanks
The text was updated successfully, but these errors were encountered:
Overview
I use some code to change field_names with regex but when the pipeline contains the steps for more than 87 fields I get this error I don't understand:
frictionless.exception.FrictionlessException: [step-error] Step is not valid: "field_update" raises "maximum recursion depth exceeded
in instancecheck"
Here is my code:
Thanks
The text was updated successfully, but these errors were encountered: