openspending / datapackage-pipelines-fiscal

Fiscal Data Package extensions to Datapackage Pipelines
MIT License
3 stars 6 forks source link

normalise-measures apparently incompatible with add_computed_field #8

Open jbothma opened 6 years ago

jbothma commented 6 years ago

In order to submit an issue, please ensure you can check the following. Thanks!

measures:
  currency: ZAR
  title: Amount
  mapping:
    "2013/14 Audited outcome":
      budget_phase: "Audited Outcome"
      financial_year: "2013"
    "2014/15 Audited outcome":
      budget_phase: "Audited Outcome"
      financial_year: "2014"

#deduplicate: true

postprocessing:
  - processor: add_computed_field
    parameters:
      resources: dedupe-measures-test
      fields:
        - operation: constant
          target: multiplication_factor
          with: 1000
        - operation: multiply
          source:
            - value
            - multiplication_factor
          target: value2

results in

ERROR log from processor fiscal.model:
+--------
| ERROR   :Missing OS Type for field multiplication_factor
| Traceback (most recent call last):
|   File "/home/jdb/proj/code4sa/treasury-portal/fiscal-data-package/env/src/datapackage-pipelines-fiscal/datapackage_pipelines_fiscal/processors/model.py", line 21, in <module>
|     field['type'] = os_types[field_name]
| KeyError: 'multiplication_factor'