Change the name of metadata keys for imported data

korrat
Jun 23, 2023, 4:31 PM
JUYXTWXP5Y52UAPROXCHVL4VL5G2DDRWGY4OX7ZXFE6GRMEV4EYQC

Dependencies

  • [2] R5K55SCB Move tagging of directives with source to framework runner
  • [3] GVEI7KND Add a importer component for CSV files
  • [4] QNGOXZL4 Add a basic framework
  • [*] R524JUUE Implement metadata & price directives

Change contents

  • replacement in importers/csv/src/lib.rs at line 97
    [3.2396][2.30:117]()
    directive.add_meta(common_keys::LINE_NUMBER, position.line());
    [3.2396]
    [3.2588]
    directive.add_meta(common_keys::IMPORTED_RECORD, position.record());
  • replacement in framework/src/runner.rs at line 223
    [2.1664][2.1664:1738]()
    directive.add_meta(common_keys::FILENAME, path.as_str());
    [2.1664]
    [2.1738]
    directive.add_meta(common_keys::IMPORTED_FROM, path.as_str());
  • edit in common/beancount-types/src/metadata/kv/common_keys.rs at line 4
    [6.9160]
    [6.9160]
    pub const IMPORTED_FROM: &MetadataKy = unsafe { MetadataKy::from_unchecked("imported-from") };
    pub const IMPORTED_RECORD: &MetadataKy = unsafe { MetadataKy::from_unchecked("imported-record") };