远大前程列出总的唯一值

Great Expectations list total unique values

我对其中一列进行了 运行 Great Expectation 检查 expect_column_values_to_be_unique 检查。它产生了以下结果 below.Total There are 62 Duplicates 但在输出列表中它只返回 20 个元素。如何检索该列中的所有重复记录。 df.expect_column_values_to_be_unique('A')

  "exception_info": null,
  "expectation_config": {
    "expectation_type": "expect_column_values_to_be_unique",
    "kwargs": {
      "column": "A",
      "result_format": "BASIC"
    },
    "meta": {}
  },
  "meta": {},
  "success": false,
  "result": {
    "element_count": 100,
    "missing_count": 0,
    "missing_percent": 0.0,
    "unexpected_count": 62,
    "unexpected_percent": 62.0,
    "unexpected_percent_nonmissing": 62.0,
    "partial_unexpected_list": [
      37,
      62,
      72,
      53,
      22,
      61,
      95,
      21,
      64,
      59,
      77,
      53,
      0,
      22,
      24,
      46,
      0,
      16,
      78,
      60
    ]
  }
}

我认为您使用的是不带参数的“show”。默认情况下,这仅显示前 20 行。如果你想看到更多,你需要传递你想看到的行数:(这将显示 200 行,而不是截断列的长度)

df.select( col("*") ).show(200,false)

您目前将 result_format 作为 BASIC 传递。要获得您正在寻找的详细程度,您需要将此 Expectation 的 result_format 作为 COMPLETE 传递,以获取意外值的完整列表。例如:

df.expect_column_values_to_be_unique(column="A", result_format="COMPLETE")

有关 result_format 的更多信息,请参阅 this documentation