Skip to content
Snippets Groups Projects
Unverified Commit 3693e165 authored by john-metabase's avatar john-metabase Committed by GitHub
Browse files

Filter import on YAML extension (#31477)


* Filter import on YAML extension

* sorts namespaces

---------

Co-authored-by: default avatarLuiz Arakaki <luiz.arakaki@metabase.com>
parent 0bc29201
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,7 @@
See the detailed description of the (de)serialization processes in [[metabase.models.serialization.base]]."
(:require
[clojure.java.io :as io]
[clojure.string :as str]
[metabase.models.serialization :as serdes]
[metabase.util.date-2 :as u.date]
[metabase.util.yaml :as yaml]
......@@ -61,6 +62,7 @@
;; This returns a map {unlabeled-hierarchy [original-hierarchy File]}.
(into {} (for [^File file (file-seq root-dir)
:when (and (.isFile file)
(str/ends-with? (.getName file) ".yaml")
(let [rel (.relativize (.toPath root-dir) (.toPath file))]
(-> rel (.subpath 0 1) (.toString) legal-top-level-paths)))
;; TODO: only load YAML once.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment