Skip to content
Snippets Groups Projects
This project is mirrored from https://github.com/metabase/metabase. Pull mirroring updated .
  1. Aug 04, 2022
  2. Aug 03, 2022
  3. Aug 02, 2022
    • dpsutton's avatar
      Handle flakiness with geojson java.net.UnknownHostException errors (#24523) · a54b36b9
      dpsutton authored
      * Handle flakiness with geojson java.net.UnknownHostException errors
      
      In CI seems like we are getting errant errors:
      
      ```clojure
      geojson.clj:62
      It validates URLs and files appropriately
      http://0xc0000200
      expected: (valid? geojson)
        actual: #error {
       :cause "Invalid IP address literal: 0xc0000200"
       :via
       [{:type clojure.lang.ExceptionInfo
         :message "Invalid GeoJSON file location: must either start with http:// or https:// or be a relative path to a file on the classpath. URLs referring to hosts that supply internal hosting metadata are prohibited."
         :data {:status-code 400, :url "http://0xc0000200"}
         :at [metabase.api.geojson$valid_url_QMARK_ invokeStatic "geojson.clj" 62]}
        {:type java.net.UnknownHostException
         :message "0xc0000200"
         :at [java.net.InetAddress getAllByName "InetAddress.java" 1340]}
        {:type java.lang.IllegalArgumentException
         :message "Invalid IP address literal: 0xc0000200"
         :at [sun.net.util.IPAddressUtil validateNumericFormatV4 "IPAddressUtil.java" 150]}]
      ```
      
      Not clear if this change has a hope of fixing it: if it doesn't resolve
      once its possible it is cached somewhere in the network stack, or it
      won't resolve if you ask again.
      
      But gonna give it a shot.
      
      Set the property `"networkaddress.cache.negative.ttl"` to `"0"`
      
      > networkaddress.cache.negative.ttl (default: 10)
      >    Indicates the caching policy for un-successful name lookups from the name service. The value is specified as an integer to indicate the number of seconds to cache the failure for un-successful lookups.
      
      >    A value of 0 indicates "never cache". A value of -1 indicates "cache forever".
      
      From
      https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/net/InetAddress.html
      in the hopes that we can try multiple times. Restores the original value
      after the test completes so we don't inadvertently change behavior
      elsewhere.
      
      If we get an error of java.net.UnknownHostException we try again if we
      have attempts remaining. If we get a boolean it means the ip resolution
      worked so we can rely on the response (checking if it resolves locally
      or not)
      
      * add a delay
      
      * comment out test
      Unverified
      a54b36b9
    • Ryan Laurie's avatar
      fix modal header typo (#24539) · 0e8e302f
      Ryan Laurie authored
      Unverified
      0e8e302f
    • dpsutton's avatar
      bump snowflake (#24480) · b5ea59aa
      dpsutton authored
      * bump snowflake
      
      * Handle Types/TIMESTAMP_WITH_TIMEZONE for snowflake
      
      Snowflake used to return columns of this type as `Types/TIMESTAMP` =
      93.
      
      The driver is registered with the legacy stuff
      
      ```clojure
      (driver/register! :snowflake,
                        :parent #{:sql-jdbc
                                  ::sql-jdbc.legacy/use-legacy-classes-for-read-and-set})
      ```
      
      causing it to hit the following codepath:
      
      ```clojure
      (defmethod sql-jdbc.execute/read-column-thunk [::use-legacy-classes-for-read-and-set Types/TIMESTAMP]
        [_ ^ResultSet rs _ ^Integer i]
        (fn []
          (when-let [s (.getString rs i)]
            (let [t (u.date/parse s)]
              (log/tracef "(.getString rs i) [TIMESTAMP] -> %s -> %s" (pr-str s) (pr-str t))
              t))))
      ```
      
      But snowflake now reports the column as `Types/TIMESTAMP_WITH_TIMEZONE`
      = 2014 in https://github.com/snowflakedb/snowflake-jdbc/pull/934/files
      we no longer hit this string based path for the timestamp with timezone
      pathway. Instead it hits
      
      ```clojure
      (defn- get-object-of-class-thunk [^ResultSet rs, ^long i, ^Class klass]
        ^{:name (format "(.getObject rs %d %s)" i (.getCanonicalName klass))}
        (fn []
          (.getObject rs i klass)))
      
      ,,,
      
      (defmethod read-column-thunk [:sql-jdbc Types/TIMESTAMP_WITH_TIMEZONE]
        [_ rs _ i]
        (get-object-of-class-thunk rs i java.time.OffsetDateTime))
      ```
      
      And `(.getObject ...)` blows up with an unsupported exception.
      
      ```java
        // @Override
        public <T> T getObject(int columnIndex, Class<T> type) throws SQLException {
          logger.debug("public <T> T getObject(int columnIndex,Class<T> type)", false);
      
          throw new SnowflakeLoggedFeatureNotSupportedException(session);
        }
      ```
      
      There seem to be some `getTimetamp` methods on the
      `SnowflakeBaseResultSet` that we could call but for now I'm just
      grabbing the string and we'll parse on our side.
      
      One style note, it is not quite clear to me if this should follow the
      pattern established in `snowflake.clj` driver of setting `defmethod
      sql-jdbc.execute/read-column-thunk [:snowflake
      Types/TIMESTAMP_WITH_TIMEZONE]` or if it should follow the legacy
      pattern of `defmethod sql-jdbc.execute/read-column-thunk
      [::use-legacy-classes-for-read-and-set Types/TIMESTAMP]`. It seems like
      almost either would be fine. Just depends on whether other legacy
      drivers might like this fix which seems possible?
      Unverified
      b5ea59aa
    • Gustavo Saiani's avatar
      Fix delete alert button style (#24512) · 20b5c75f
      Gustavo Saiani authored
      Unverified
      20b5c75f
    • Nemanja Glumac's avatar
      [E2E] Consolidate `dashboard-filters` tests (#24472) · 0b54c083
      Nemanja Glumac authored
      * Move support JS files inline with the test
      
      * Fix and unskip repro for 12720
      
      * Update syntax in 12985 repro
      
      - Removed unnecessary dashboard filter
      - Simplify repros
      
      * Use the existing test to reproduce 13960
      
      * Add repro for #16112
      
      * Remove unnecessary intercepts
      
      * Merge 13150, 15689, 15695 and 16103 together
      
      * Use the existing test to reproduce 17139
      
      * Move repro for 6660 to date filters file
      Unverified
      0b54c083
    • Braden Shepherdson's avatar
      Serdes v2: Handle `Card.dataset_query`, an embedded MBQL snippet (#24356) · a13faa7d
      Braden Shepherdson authored
      These snippets contain raw `Database`, `Table`, and `Field` IDs, and so are not portable. This PR proves out the concept for `Card.dataset_query`, paving the way for the others in a follow-up PR.
      Unverified
      a13faa7d
    • Anton Kulyk's avatar
      Change button label (#24531) · e2e6a170
      Anton Kulyk authored
      Unverified
      e2e6a170
    • Ryan Laurie's avatar
      Bulk filter Modal: Make search visible (#24526) · da88cc8a
      Ryan Laurie authored
      * make search visible
      
      * update Modal title
      Unverified
      da88cc8a
    • Nick Fitzpatrick's avatar
      Fixing null error when value is null and isCustom is true (#24517) · f32550c6
      Nick Fitzpatrick authored
      * Fixing null error when value is null and isCustom is true
      
      * PR Feedback
      Unverified
      f32550c6
    • Ryan Laurie's avatar
    • Jeff Bruemmer's avatar
      exception for none and block (#24475) · 4f677ed0
      Jeff Bruemmer authored
      * exception for none and block
      
      * add howon's test
      Unverified
      4f677ed0
    • Jeff Bruemmer's avatar
    • Aleksandr Lesnenko's avatar
      open urls with the site-url origin in the same tab (#24489) · 4ac2ef97
      Aleksandr Lesnenko authored
      * open urls with the site-url origin in the same tab
      
      * revoew
      Unverified
      4ac2ef97
    • Noah Moss's avatar
      Optional blocks in Markdown cards (#24491) · 99ad6c05
      Noah Moss authored
      Unverified
      99ad6c05
    • Nick Fitzpatrick's avatar
    • Howon Lee's avatar
      Enforce bigint for all int fields derived from JSON instead of doing more... · 55f7b547
      Howon Lee authored
      Enforce bigint for all int fields derived from JSON instead of doing more complete refactor (#24494)
      
      Pursuant to #22732. Should basically eliminate it with prejudice by saying that any int should fit bigints in our point of view in postgres.
      Unverified
      55f7b547
Loading