Skip to content

Commit 651d14b

Browse files
committed
Correctly map the mappings column for older resolver_vis_map.tab files
1 parent bc80342 commit 651d14b

2 files changed

Lines changed: 13 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
55

66
## [Unreleased]
77

8+
### Fixed
9+
10+
- Correctly map the `mappings` column for older `resolver_vis_map.tab` files
11+
that do have a `visibility` column.
12+
813
## [3.7.0] - 2025-03-18
914

1015
### Fixed

graphannis/src/annis/db/relannis.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -484,15 +484,14 @@ where
484484
));
485485

486486
let mut resolver_tab_csv = postgresql_import_reader(resolver_tab_path.as_path())?;
487-
488487
let mut rules_by_order: Vec<(i64, bool, VisualizerRule)> = DEFAULT_VISUALIZER_RULES.clone();
489488

490-
let order_col = if is_annis_33 { 7 } else { 6 };
491-
let mapping_col = if is_annis_33 { 8 } else { 7 };
492-
493489
for result in resolver_tab_csv.records() {
494490
let line = result?;
495491

492+
let order_col = if is_annis_33 || line.len() == 9 { 7 } else { 6 };
493+
let mapping_col = if is_annis_33 || line.len() == 9 { 8 } else { 7 };
494+
496495
let layer = get_field(&line, 2, "namespace", &resolver_tab_path)?.map(|l| l.to_string());
497496
let element =
498497
get_field(&line, 3, "element", &resolver_tab_path)?.and_then(|e| match e.as_ref() {
@@ -503,7 +502,11 @@ where
503502
let vis_type = get_field_not_null(&line, 4, "vis_type", &resolver_tab_path)?;
504503
let display_name = get_field_not_null(&line, 5, "display_name", &resolver_tab_path)?;
505504

506-
let visibility = get_field_not_null(&line, 6, "visibility", &resolver_tab_path)?;
505+
let visibility = if line.len() < 7 {
506+
"hidden".into()
507+
} else {
508+
get_field_not_null(&line, 6, "visibility", &resolver_tab_path)?
509+
};
507510

508511
let order = get_field(&line, order_col, "order", &resolver_tab_path)?
509512
.map(|order| order.parse::<i64>().unwrap_or_default())

0 commit comments

Comments
 (0)