Skip to content

Commit

Permalink
~ fix type hints
Browse files Browse the repository at this point in the history
  • Loading branch information
calherries committed Jun 20, 2024
1 parent f23d75b commit 5dfe039
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
1 change: 0 additions & 1 deletion .clj-kondo/config.edn
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
;;
;; disabled linters
;;
:non-arg-vec-return-type-hint {:level :off} ; Moving the type hints to the arg lists makes clj-kondo happy, but breaks eastwood (and maybe causes reflection warnings) at the call sites.
:unexpected-recur {:level :off} ; TODO (cam): I think we just need to tell it how to handle MBQL match and we can enable this?
:used-underscored-binding {:level :off} ; false positives: see https://github.com/clj-kondo/clj-kondo/issues/2152

Expand Down
2 changes: 1 addition & 1 deletion modules/drivers/oracle/src/metabase/driver/oracle.clj
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@
(fn []
(.getString rs i)))

(defn- ^Connection rs->conn [^ResultSet rs]
(defn- rs->conn ^Connection [^ResultSet rs]
(let [^C3P0ProxyConnection proxy-conn (.. rs getStatement getConnection)]
(.unwrap proxy-conn OracleConnection)))

Expand Down
8 changes: 3 additions & 5 deletions src/metabase/util/date_2.clj
Original file line number Diff line number Diff line change
Expand Up @@ -431,18 +431,16 @@
:exclusive (add t resolution -1)))}
:= (range t unit options))))

(defn ^PeriodDuration period-duration
(defn period-duration
"Return the Duration between two temporal values `x` and `y`."
{:arglists '([s] [period] [duration] [period duration] [start end])}
([x]
(^PeriodDuration [x]
(when x
(condp instance? x
PeriodDuration x
CharSequence (PeriodDuration/parse x)
Period (PeriodDuration/of ^Period x)
Duration (PeriodDuration/of ^Duration x))))

([x y]
(^PeriodDuration [x y]
(cond
(and (instance? Period x) (instance? Duration y))
(PeriodDuration/of x y)
Expand Down

0 comments on commit 5dfe039

Please sign in to comment.