Skip to content

Commit

Permalink
Further enhance the error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
stevorobs3 committed Dec 4, 2023
1 parent 7eda82e commit 9a3acfa
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/csv2rdf/metadata/schema.clj
Original file line number Diff line number Diff line change
Expand Up @@ -120,19 +120,23 @@
common-indexes (set/intersection (set (keys col1-non-virtual)) (set (keys col2-non-virtual)))]
;;Two schemas are compatible if they have the same number of non-virtual column descriptions,
(when-not (= (count col1-non-virtual) (count col2-non-virtual))
(logging/log-warning (format "Schemas have different number of non-virtual columns for schemas: %s %s"
(logging/log-warning (format "Schemas have different number of non-virtual columns for schemas: %s %s, non virtual columns are: %s %s"
(schema-file-name schema1)
(schema-file-name schema2))))
(schema-file-name schema2)
col1-non-virtual
col2-non-virtual)))

;;and the non-virtual column descriptions at the same index within each are compatible with each other
(doseq [idx common-indexes]
(let [col1 (get col1-non-virtual idx)
col2 (get col2-non-virtual idx)]
(when-not (column/compatible? validating? col1 col2)
(logging/log-warning (format "Columns at index %d not compatible for schemas: %s %s"
(logging/log-warning (format "Columns at index %d not compatible for schemas: %s %s and columns: %s %s"
idx
(schema-file-name schema1)
(schema-file-name schema2))))))))))
(schema-file-name schema2)
col1
col2)))))))))

(defn compatibility-merge [user-schema embedded-schema]
(update user-schema :columns merge-columns (:columns embedded-schema)))

0 comments on commit 9a3acfa

Please sign in to comment.