"Fields that have at least this percent of values that are valid URLs should be marked as `special_type = :url`."
0.95)
;; TODO - this fails for postgres tables that we consider TextFields but don't work for char_length, such as UUID fields
;; This is not a big deal since we wouldn't want to mark those as URLs any way, but we should do casting here to avoid
;; that issue in the first place
(defn-field-percent-urls
"Return the percentage of non-null values of FIELD that are valid URLS."
{:arglists'([korma-tablefield])}
...
...
@@ -347,7 +350,7 @@
(if(=total-non-null-count0)0
(let[url-count(->(selectkorma-table
(aggregate(count:*):count)
(where{(raw(format"CAST(\"%s\" AS TEXT)"(namefield-name)))[like"http%://_%.__%"]}))first:count)]; This is how the old Django app worked. Didn't match URLs like
(where{(keywordfield-name)[like"http%://_%.__%"]}))first:count)]; This is how the old Django app worked. Didn't match URLs like
(float(/url-counttotal-non-null-count)))))); "www.zagat.com". Is this what we want?