                      (map (juxt key #(tablet/from-records f (val %))))
                      (map (partial apply store-tablet! store))
                      (into {}))})
-      (partition-approx target-count records))))
+      (partition-approx part-count records))))
 
 
 

  (let [records (sort-by first key/compare records)
        limit (or (::limit parameters) 100000)
        families (or (::data/families parameters) {})
        target-count (/ (count records)
                        (inc (int (/ (count records)
                                     limit))))]
    (map
      (fn make-partition
        [partition-records]

;; ## Utilities

(defn- partition-approx
  "Returns a lazy sequence of `n` lists containing the elements of `coll` in
  order, where each list is approximately the same size."
  [n coll]
  (->>
    [nil
     (->> (range (inc n))
          (map #(int (* (/ % n) (count coll))))
          (partition 2 1))
     coll]
    (iterate
      (fn [[_ [[start end :as split] & splits] xs]]
        (when-let [length (and split (- end start))]
          [(seq (take length xs))
           splits
           (drop length xs)])))
    (drop 1)
    (take-while first)
    (map first)))
