Bins not working on version on v0.43.4

Hello, I created a question and grouped using bins. The question worked fine the first time around but after a day of saving the question I get this error.

After inspecting the question, I notice that there is no binning option for the column that I selected:

The logs display the following:

[14fff1f1-60b3-4011-95af-16b7221eace1] 2022-07-06T09:06:06-05:00 ERROR metabase.query-processor.middleware.catch-exceptions Error procesando consulta: Unable to bin Field without a min/max value
{:database_id 2,
 :started_at #t "2022-07-06T09:06:02.615485-05:00[America/Guayaquil]",
 :via
 [{:status :failed,
   :class clojure.lang.ExceptionInfo,
   :error "Unable to bin Field without a min/max value",
   :stacktrace
   ["--> query_processor.middleware.binning$update_binning_strategy_in_inner_query$replace_40418__40419.invoke(binning.clj:214)"
    "mbql.util.match.impl$replace_in_collection.invokeStatic(impl.cljc:47)"
    "mbql.util.match.impl$replace_in_collection.invoke(impl.cljc:38)"
    "query_processor.middleware.binning$update_binning_strategy_in_inner_query$replace_40418__40419.invoke(binning.clj:214)"
    "mbql.util.match.impl$replace_in_collection$iter__20130__20134$fn__20135.invoke(impl.cljc:44)"
    "mbql.util.match.impl$replace_in_collection.invokeStatic(impl.cljc:43)"
    "mbql.util.match.impl$replace_in_collection.invoke(impl.cljc:38)"
    "query_processor.middleware.binning$update_binning_strategy_in_inner_query$replace_40418__40419.invoke(binning.clj:214)"
    "query_processor.middleware.binning$update_binning_strategy_in_inner_query.invokeStatic(binning.clj:214)"
    "query_processor.middleware.binning$update_binning_strategy_in_inner_query.invoke(binning.clj:210)"
    "query_processor.middleware.binning$update_binning_strategy.invokeStatic(binning.clj:228)"
    "query_processor.middleware.binning$update_binning_strategy.invoke(binning.clj:221)"
    "query_processor$preprocess_STAR_$fn__52913.invoke(query_processor.clj:124)"
    "query_processor$preprocess_STAR_.invokeStatic(query_processor.clj:122)"
    "query_processor$preprocess_STAR_.invoke(query_processor.clj:117)"
    "query_processor$fn__52921$combined_pre_process__52922$combined_pre_process_STAR___52923.invoke(query_processor.clj:204)"
    "query_processor.middleware.resolve_database_and_driver$resolve_database_and_driver$fn__51368$fn__51373.invoke(resolve_database_and_driver.clj:35)"
    "driver$do_with_driver.invokeStatic(driver.clj:75)"
    "driver$do_with_driver.invoke(driver.clj:71)"
    "query_processor.middleware.resolve_database_and_driver$resolve_database_and_driver$fn__51368.invoke(resolve_database_and_driver.clj:34)"
    "query_processor.middleware.fetch_source_query$resolve_card_id_source_tables$fn__47473.invoke(fetch_source_query.clj:277)"
    "query_processor.middleware.store$initialize_store$fn__47661$fn__47662.invoke(store.clj:11)"
    "query_processor.store$do_with_store.invokeStatic(store.clj:44)"
    "query_processor.store$do_with_store.invoke(store.clj:38)"
    "query_processor.middleware.store$initialize_store$fn__47661.invoke(store.clj:10)"
    "query_processor.middleware.normalize_query$normalize$fn__51640.invoke(normalize_query.clj:22)"
    "query_processor.middleware.constraints$add_default_userland_constraints$fn__48730.invoke(constraints.clj:53)"
    "query_processor.middleware.process_userland_query$process_userland_query$fn__51579.invoke(process_userland_query.clj:145)"
    "query_processor.middleware.catch_exceptions$catch_exceptions$fn__51951.invoke(catch_exceptions.clj:168)"
    "query_processor.reducible$async_qp$qp_STAR___44200$thunk__44202.invoke(reducible.clj:100)"
    "query_processor.reducible$async_qp$qp_STAR___44200$fn__44204.invoke(reducible.clj:105)"],
   :ex-data {:clause [:field "Ventas" {:binning {:strategy :default}, :base-type :type/Float}]}}],
 :error_type :invalid-query,
 :json_query
 {:constraints {:max-results 10000, :max-results-bare-rows 2000},
  :type :query,
  :middleware {:js-int-to-string? true, :ignore-cached-results? false},
  :database 2,
  :query
  {:source-table "card__39",
   :filter
   [:and
    [:!= [:field "Ventas" {:base-type :type/Float}] 0]
    [:time-interval [:field "created_at" {:base-type :type/DateTimeWithLocalTZ}] :current :month]],
   :aggregation
   [[:cum-sum [:field "Ventas" {:base-type :type/Float}]]
    [:count]
    [:aggregation-options
     [:percentile [:field "Ventas" {:base-type :type/Float}] 0.25]
     {:name "25%", :display-name "25%"}]
    [:aggregation-options
     [:percentile [:field "Ventas" {:base-type :type/Float}] 0.5]
     {:name "50%", :display-name "50%"}]
    [:aggregation-options
     [:percentile [:field "Ventas" {:base-type :type/Float}] 0.75]
     {:name "75%", :display-name "75%"}]],
   :breakout [[:field "Ventas" {:binning {:strategy :default}, :base-type :type/Float}]]},
  :parameters [],
  :async? true,
  :cache-ttl 18},
 :native nil,
 :status :failed,
 :class clojure.lang.ExceptionInfo,
 :stacktrace
 ["--> query_processor.middleware.binning$fn__40133$extract_bounds__40138$fn__40139.invoke(binning.clj:49)"
  "query_processor.middleware.binning$fn__40133$extract_bounds__40138.invoke(binning.clj:30)"
  "query_processor.middleware.binning$fn__40376$update_binned_field__40381$fn__40394.invoke(binning.clj:197)"
  "query_processor.middleware.binning$fn__40376$update_binned_field__40381.invoke(binning.clj:189)"
  "query_processor.middleware.binning$update_binning_strategy_in_inner_query$replace_40418__40419.invoke(binning.clj:214)"
  "mbql.util.match.impl$replace_in_collection.invokeStatic(impl.cljc:47)"
  "mbql.util.match.impl$replace_in_collection.invoke(impl.cljc:38)"
  "query_processor.middleware.binning$update_binning_strategy_in_inner_query$replace_40418__40419.invoke(binning.clj:214)"
  "mbql.util.match.impl$replace_in_collection$iter__20130__20134$fn__20135.invoke(impl.cljc:44)"
  "mbql.util.match.impl$replace_in_collection.invokeStatic(impl.cljc:43)"
  "mbql.util.match.impl$replace_in_collection.invoke(impl.cljc:38)"
  "query_processor.middleware.binning$update_binning_strategy_in_inner_query$replace_40418__40419.invoke(binning.clj:214)"
  "query_processor.middleware.binning$update_binning_strategy_in_inner_query.invokeStatic(binning.clj:214)"
  "query_processor.middleware.binning$update_binning_strategy_in_inner_query.invoke(binning.clj:210)"
  "query_processor.middleware.binning$update_binning_strategy.invokeStatic(binning.clj:228)"
  "query_processor.middleware.binning$update_binning_strategy.invoke(binning.clj:221)"
  "query_processor$preprocess_STAR_$fn__52913.invoke(query_processor.clj:124)"
  "query_processor$preprocess_STAR_.invokeStatic(query_processor.clj:122)"
  "query_processor$preprocess_STAR_.invoke(query_processor.clj:117)"
  "query_processor$fn__52921$combined_pre_process__52922$combined_pre_process_STAR___52923.invoke(query_processor.clj:204)"
  "query_processor.middleware.resolve_database_and_driver$resolve_database_and_driver$fn__51368$fn__51373.invoke(resolve_database_and_driver.clj:35)"
  "driver$do_with_driver.invokeStatic(driver.clj:75)"
  "driver$do_with_driver.invoke(driver.clj:71)"
  "query_processor.middleware.resolve_database_and_driver$resolve_database_and_driver$fn__51368.invoke(resolve_database_and_driver.clj:34)"
  "query_processor.middleware.fetch_source_query$resolve_card_id_source_tables$fn__47473.invoke(fetch_source_query.clj:277)"
  "query_processor.middleware.store$initialize_store$fn__47661$fn__47662.invoke(store.clj:11)"
  "query_processor.store$do_with_store.invokeStatic(store.clj:44)"
  "query_processor.store$do_with_store.invoke(store.clj:38)"
  "query_processor.middleware.store$initialize_store$fn__47661.invoke(store.clj:10)"
  "query_processor.middleware.normalize_query$normalize$fn__51640.invoke(normalize_query.clj:22)"
  "query_processor.middleware.constraints$add_default_userland_constraints$fn__48730.invoke(constraints.clj:53)"
  "query_processor.middleware.process_userland_query$process_userland_query$fn__51579.invoke(process_userland_query.clj:145)"
  "query_processor.middleware.catch_exceptions$catch_exceptions$fn__51951.invoke(catch_exceptions.clj:168)"
  "query_processor.reducible$async_qp$qp_STAR___44200$thunk__44202.invoke(reducible.clj:100)"
  "query_processor.reducible$async_qp$qp_STAR___44200$fn__44204.invoke(reducible.clj:105)"],
 :card_id 1057,
 :context :dashboard,
 :error "Unable to bin Field without a min/max value",
 :row_count 0,
 :running_time 0,
 :preprocessed nil,
 :ex-data
 {:type :invalid-query,
  :field-id nil,
  :fingerprint
  {:global {:distinct-count 0, :nil% nil},
   :type {:type/Number {:min nil, :q1 nil, :q3 nil, :max nil, :sd nil, :avg nil}}}},
 :data {:rows [], :cols []}}

Hi @rviteri
Metabase gets the fingerprinting information used for the binning from upstream, so that would either by table sync metadata or question result metadata. In your case, it's coming from question 39.
So I'm guessing that something in question 39 changed, which then broke downstream questions.

Include the output of /api/card/39

{
"description": null,
"archived": false,
"collection_position": 10,
"table_id": null,
"result_metadata": [
{
"display_name": "id",
"field_ref": [
"field",
"id",
{
"base-type": "type/BigInteger"
}
],
"name": "id",
"base_type": "type/BigInteger",
"effective_type": "type/BigInteger",
"semantic_type": "type/PK",
"fingerprint": null
},
{
"display_name": "created_at",
"field_ref": [
"field",
"created_at",
{
"base-type": "type/DateTimeWithLocalTZ"
}
],
"name": "created_at",
"base_type": "type/DateTimeWithLocalTZ",
"effective_type": "type/DateTimeWithLocalTZ",
"semantic_type": "type/CreationTimestamp",
"fingerprint": {
"global": {
"distinct-count": 0,
"nil%": null
},
"type": {
"type/DateTime": {
"earliest": null,
"latest": null
}
}
}
},
{
"display_name": "Fecha",
"field_ref": [
"field",
"Fecha",
{
"base-type": "type/Date"
}
],
"name": "Fecha",
"base_type": "type/Date",
"effective_type": "type/Date",
"semantic_type": null,
"fingerprint": {
"global": {
"distinct-count": 0,
"nil%": null
},
"type": {
"type/DateTime": {
"earliest": null,
"latest": null
}
}
}
},
{
"display_name": "orden_trabajo",
"field_ref": [
"field",
"orden_trabajo",
{
"base-type": "type/BigInteger"
}
],
"name": "orden_trabajo",
"base_type": "type/BigInteger",
"effective_type": "type/BigInteger",
"semantic_type": null,
"fingerprint": {
"global": {
"distinct-count": 0,
"nil%": null
},
"type": {
"type/Number": {
"min": null,
"q1": null,
"q3": null,
"max": null,
"sd": null,
"avg": null
}
}
}
},
{
"display_name": "Paciente",
"field_ref": [
"field",
"Paciente",
{
"base-type": "type/Text"
}
],
"name": "Paciente",
"base_type": "type/Text",
"effective_type": "type/Text",
"semantic_type": null,
"fingerprint": {
"global": {
"distinct-count": 0,
"nil%": null
},
"type": {
"type/Text": {
"percent-json": null,
"percent-url": null,
"percent-email": null,
"percent-state": null,
"average-length": null
}
}
}
},
{
"display_name": "cedula_doctor",
"field_ref": [
"field",
"cedula_doctor",
{
"base-type": "type/Text"
}
],
"name": "cedula_doctor",
"base_type": "type/Text",
"effective_type": "type/Text",
"semantic_type": null,
"fingerprint": {
"global": {
"distinct-count": 0,
"nil%": null
},
"type": {
"type/Text": {
"percent-json": null,
"percent-url": null,
"percent-email": null,
"percent-state": null,
"average-length": null
}
}
}
},
{
"display_name": "Doctor",
"field_ref": [
"field",
"Doctor",
{
"base-type": "type/Text"
}
],
"name": "Doctor",
"base_type": "type/Text",
"effective_type": "type/Text",
"semantic_type": null,
"fingerprint": {
"global": {
"distinct-count": 0,
"nil%": null
},
"type": {
"type/Text": {
"percent-json": null,
"percent-url": null,
"percent-email": null,
"percent-state": null,
"average-length": null
}
}
}
},
{
"display_name": "asociado",
"field_ref": [
"field",
"asociado",
{
"base-type": "type/Integer"
}
],
"name": "asociado",
"base_type": "type/Integer",
"effective_type": "type/Integer",
"semantic_type": null,
"fingerprint": {
"global": {
"distinct-count": 0,
"nil%": null
},
"type": {
"type/Number": {
"min": null,
"q1": null,
"q3": null,
"max": null,
"sd": null,
"avg": null
}
}
}
},
{
"display_name": "Laboratorio",
"field_ref": [
"field",
"Laboratorio",
{
"base-type": "type/Text"
}
],
"name": "Laboratorio",
"base_type": "type/Text",
"effective_type": "type/Text",
"semantic_type": null,
"fingerprint": {
"global": {
"distinct-count": 0,
"nil%": null
},
"type": {
"type/Text": {
"percent-json": null,
"percent-url": null,
"percent-email": null,
"percent-state": null,
"average-length": null
}
}
}
},
{
"display_name": "Lib",
"field_ref": [
"field",
"Lib",
{
"base-type": "type/Text"
}
],
"name": "Lib",
"base_type": "type/Text",
"effective_type": "type/Text",
"semantic_type": null,
"fingerprint": {
"global": {
"distinct-count": 0,
"nil%": null
},
"type": {
"type/Text": {
"percent-json": null,
"percent-url": null,
"percent-email": null,
"percent-state": null,
"average-length": null
}
}
}
},
{
"display_name": "P",
"field_ref": [
"field",
"P",
{
"base-type": "type/Text"
}
],
"name": "P",
"base_type": "type/Text",
"effective_type": "type/Text",
"semantic_type": null,
"fingerprint": {
"global": {
"distinct-count": 0,
"nil%": null
},
"type": {
"type/Text": {
"percent-json": null,
"percent-url": null,
"percent-email": null,
"percent-state": null,
"average-length": null
}
}
}
},
{
"display_name": "saldo",
"field_ref": [
"field",
"saldo",
{
"base-type": "type/Decimal"
}
],
"name": "saldo",
"base_type": "type/Decimal",
"effective_type": "type/Decimal",
"semantic_type": null,
"fingerprint": {
"global": {
"distinct-count": 0,
"nil%": null
},
"type": {
"type/Number": {
"min": null,
"q1": null,
"q3": null,
"max": null,
"sd": null,
"avg": null
}
}
}
},
{
"display_name": "abono",
"field_ref": [
"field",
"abono",
{
"base-type": "type/Float"
}
],
"name": "abono",
"base_type": "type/Float",
"effective_type": "type/Float",
"semantic_type": null,
"fingerprint": {
"global": {
"distinct-count": 0,
"nil%": null
},
"type": {
"type/Number": {
"min": null,
"q1": null,
"q3": null,
"max": null,
"sd": null,
"avg": null
}
}
}
},
{
"display_name": "descuento",
"field_ref": [
"field",
"descuento",
{
"base-type": "type/Float"
}
],
"name": "descuento",
"base_type": "type/Float",
"effective_type": "type/Float",
"semantic_type": null,
"fingerprint": {
"global": {
"distinct-count": 0,
"nil%": null
},
"type": {
"type/Number": {
"min": null,
"q1": null,
"q3": null,
"max": null,
"sd": null,
"avg": null
}
}
}
},
{
"display_name": "Ventas",
"field_ref": [
"field",
"Ventas",
{
"base-type": "type/Float"
}
],
"name": "Ventas",
"base_type": "type/Float",
"effective_type": "type/Float",
"semantic_type": null,
"fingerprint": {
"global": {
"distinct-count": 0,
"nil%": null
},
"type": {
"type/Number": {
"min": null,
"q1": null,
"q3": null,
"max": null,
"sd": null,
"avg": null
}
}
}
},
{
"display_name": "Total",
"field_ref": [
"field",
"Total",
{
"base-type": "type/Float"
}
],
"name": "Total",
"base_type": "type/Float",
"effective_type": "type/Float",
"semantic_type": null,
"fingerprint": {
"global": {
"distinct-count": 0,
"nil%": null
},
"type": {
"type/Number": {
"min": null,
"q1": null,
"q3": null,
"max": null,
"sd": null,
"avg": null
}
}
}
},
{
"display_name": "TPago",
"field_ref": [
"field",
"TPago",
{
"base-type": "type/Text"
}
],
"name": "TPago",
"base_type": "type/Text",
"effective_type": "type/Text",
"semantic_type": null,
"fingerprint": {
"global": {
"distinct-count": 0,
"nil%": null
},
"type": {
"type/Text": {
"percent-json": null,
"percent-url": null,
"percent-email": null,
"percent-state": null,
"average-length": null
}
}
}
},
{
"display_name": "Emp",
"field_ref": [
"field",
"Emp",
{
"base-type": "type/Text"
}
],
"name": "Emp",
"base_type": "type/Text",
"effective_type": "type/Text",
"semantic_type": null,
"fingerprint": {
"global": {
"distinct-count": 0,
"nil%": null
},
"type": {
"type/Text": {
"percent-json": null,
"percent-url": null,
"percent-email": null,
"percent-state": null,
"average-length": null
}
}
}
},
{
"display_name": "Vendedor",
"field_ref": [
"field",
"Vendedor",
{
"base-type": "type/Text"
}
],
"name": "Vendedor",
"base_type": "type/Text",
"effective_type": "type/Text",
"semantic_type": null,
"fingerprint": {
"global": {
"distinct-count": 0,
"nil%": null
},
"type": {
"type/Text": {
"percent-json": null,
"percent-url": null,
"percent-email": null,
"percent-state": null,
"average-length": null
}
}
}
},
{
"display_name": "Comision",
"field_ref": [
"field",
"Comision",
{
"base-type": "type/Decimal"
}
],
"name": "Comision",
"base_type": "type/Decimal",
"effective_type": "type/Decimal",
"semantic_type": null,
"fingerprint": {
"global": {
"distinct-count": 0,
"nil%": null
},
"type": {
"type/Number": {
"min": null,
"q1": null,
"q3": null,
"max": null,
"sd": null,
"avg": null
}
}
}
},
{
"display_name": "Porcentaje",
"field_ref": [
"field",
"Porcentaje",
{
"base-type": "type/Float"
}
],
"name": "Porcentaje",
"base_type": "type/Float",
"effective_type": "type/Float",
"semantic_type": null,
"fingerprint": {
"global": {
"distinct-count": 0,
"nil%": null
},
"type": {
"type/Number": {
"min": null,
"q1": null,
"q3": null,
"max": null,
"sd": null,
"avg": null
}
}
}
}
],
"creator": {
"email": "rviteri@estratega.ec",
"first_name": "Ricardo",
"last_login": "2022-07-06T14:09:18.805363Z",
"is_qbnewb": false,
"is_superuser": true,
"id": 1,
"last_name": "Viteri",
"date_joined": "2018-08-30T07:33:29.336Z",
"common_name": "Ricardo Viteri"
},
"can_write": true,
"database_id": 2,
"enable_embedding": false,
"collection_id": null,
"query_type": "native",
"name": "Tabla maestra REDUCIDA",
"last_query_start": "2022-07-06T13:10:18.248266Z",
"dashboard_count": 0,
"average_query_time": 2578.743455497382,
"creator_id": 1,
"moderation_reviews": [],
"updated_at": "2022-07-05T16:19:37.867663Z",
"made_public_by_id": null,
"embedding_params": null,
"cache_ttl": null,
"dataset_query": {
"native": {
"query": "SELECT \r\nt.id,\r\nT.created_at,\r\nT.fecha AS \"Fecha\",\r\nT.orden_trabajo,\r\nCONCAT( P.apellidos,  ' ',P.nombre ) AS \"Paciente\", \r\nA.cedula AS cedula_doctor,\r\nCONCAT( A.apellidos,  ' ', A.nombre ) AS \"Doctor\",\r\nB.asociado,\r\nL.nombre AS \"Laboratorio\",\r\ncase when PD.liberado = 1 then '1' else '0' END \"Lib\",\r\ncase when PD.pagado = 1 then '1' else '0' END \"P\",\r\nROUND(ABS(coalesce(PD.saldo, 0) - coalesce(PD.abono, 0) -  coalesce(PD.desc,0))::numeric, 2) AS \"saldo\",  \r\nPD.abono as Abono,\r\ncoalesce(PD.desc,0) as Descuento,\r\n(ABS(coalesce(PD.saldo, 0) - coalesce(PD.abono, 0) -  coalesce(PD.desc,0)) + coalesce(PD.abono,0)) as \"Ventas\",\r\nvalor_total \"Total\",\r\nF.abreviatura as \"TPago\",\r\nPD.empresa as \"Emp\",\r\n(\r\nSELECT CONCAT( M.apellidos,  ' ', M.nombre )\r\nFROM adm_user M\r\nWHERE M.id = B.id_vendedor\r\n) AS  \"Vendedor\",\r\n-- ABS(ROUND((PD.saldo -  nullif(PD.desc,0))*(C.porcentaje/100),2))  AS Comision,\r\nABS(ROUND(((coalesce(PD.saldo, 0) -  coalesce(PD.desc,0))*(C.porcentaje/100))::numeric,2))  AS \"Comision\",\r\nC.porcentaje AS \"Porcentaje\"\r\nFROM test_completo T\r\nINNER JOIN pagos_detalles PD ON PD.id_test_completo = T.id\r\nINNER JOIN adm_empresa L ON T.id_empresa = L.id\r\nINNER JOIN adm_user A ON T.id_doctor = A.id\r\nINNER JOIN adm_user_doctor B ON A.id = B.id\r\nINNER JOIN comisiones C ON C.id = B.id_comisiones\r\nINNER JOIN pacientes P ON P.id = T.id_paciente\r\nLEFT JOIN forma_pago F ON  PD.tipopago = F.idformapago\r\n/*INNER JOIN registro_pagos R ON R.id_pagos_detalles = PD.id*/\r\n/*WHERE YEAR(T.fecha) = YEAR(CURDATE()) - 1*/\r\nORDER BY id  desc",
"template-tags": {}
},
"type": "native",
"database": 2
},
"id": 39,
"display": "table",
"last-edit-info": {
"id": 338,
"email": "egarcia@estratega.ec",
"first_name": "Erick",
"last_name": "Garcia",
"timestamp": "2022-06-16T22:04:35.800876Z"
},
"visualization_settings": {
"table.pivot_column": "Emp",
"table.cell_column": "Ventas"
},
"collection": null,
"dataset": false,
"created_at": "2018-09-06T20:52:38.099Z",
"public_uuid": null
}

@rviteri Try going to /question/39, which should update all the fingerprints, when the query is executed. I don't know why it has lost its fingerprints, but perhaps there was a query error at one point.

1 Like