浏览代码

Merge branch 'oskar-dev' of https://intra.acdp.at/gogs/tanja/cdplib into oskar-dev

ogert 4 年之前
父节点
当前提交
fffd4eb29f
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      cdplib/db_migration/DataFrameToCollection.py

+ 2 - 1
cdplib/db_migration/DataFrameToCollection.py

@@ -94,7 +94,8 @@ class DataFrameToCollection():
                 # check that there is only one possible value of this field
                 n_distinct_values = data.groupby(grp_fields, sort=False)[field].nunique().max()
                 
-                if n_distinct_values != 1:
+                # n_distinct_valus can be 0 if the column only contains NaN values
+                if n_distinct_values > 1:
                     err = "Field {0} is not unique with respect to {1}"\
                           .format(field, grp_fields)