splor-mg / dpm

https://splor-mg.github.io/dpm/
0 stars 0 forks source link

Step is not valid: "field_update" raises "[error] resource is not open " #32

Open fjuniorr opened 1 year ago

fjuniorr commented 1 year ago

Não consegui entender o que está acontecendo e esse ainda parece ser um erro intermitente.

python main.py transform base_qdd_plurianual data/base_qdd_plurianual.csv
FrictionlessException: [error] resource is not open 
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /Users/macbook/Projects/splor/sisor-dados/scripts/transform.py:13 in transform_resource          │
│                                                                                                  │
│   10 │   logger.info(f'Transforming resource {resource_name}')                                   │
│   11 │   package = Package(descriptor)                                                           │
│   12 │   resource = package.get_resource(resource_name)                                          │
│ ❱ 13 │   target = normalize_resource(resource, path = Path(f'data/{resource_name}.csv'))         │
│   14                                                                                             │
│                                                                                                  │
│ /Users/macbook/Projects/splor/dpm/src/dpm/steps.py:122 in normalize_resource                     │
│                                                                                                  │
│   119 │   │   │   field.custom['target'] = as_identifier(field.name)                             │
│   120 │   │   target = field.custom['target']                                                    │
│   121 │   │   field_descriptor = {'name': target, 'source': field.name}                          │
│ ❱ 122 │   │   transform(resource, steps=[steps.field_update(name = field.name, descriptor = fi   │
│   123 │   │   resource.schema.get_field(target).custom.pop('target', None)                       │
│   124 │                                                                                          │
│   125 │   transform(resource, steps=[steps.table_normalize()])