Project

General

Profile

« Previous | Next » 

Revision 8820

lib/sql_io.py: put_table(): Calling wrapper function: adding pkey or index on the resulting table: don't display warning if a pkey can't be added, because this is actually a legitimate situation when the called function is set-returning and can return multiple rows for one input. having this as a warning results in spurious warnings in the automated tests (which look confusingly like ignored errors because Python warnings include debugging context information). e.g. `make inputs/Madidi/IndividualObservation/test.by_col.xml` causes this error in the sourcelist->sourcename splitting step (which of course can produce multiple specimenholder institutions).
  • note that a diff will continue to be produced (but now without an error message), because row-based import does not fully support set-returning functions (it only uses the first row). this diff does indicate a bug, which does not need to be fixed as long as we are using column-based import for the actual import. ***

View differences:

lib/sql_io.py
663 663
                    log_debug('Calling function')
664 664
                    insert_into_pkeys(sql.mk_select(db, wrapper_table,
665 665
                        order_by=None), recover=True, cacheable=False)
666
                    sql.add_pkey_or_index(db, into, warn=True)
666
                    sql.add_pkey_or_index(db, into)
667 667
            else:
668 668
                cur = sql.insert_select(db, out_table, mapping.keys(),
669 669
                    main_select, **insert_args)

Also available in: Unified diff