Skip to content

fix: handle null property values in PP XML v69+#44

Merged
ma4nn merged 1 commit intoma4nn:masterfrom
dgehriger:fix/handle-null-property-values
Apr 14, 2026
Merged

fix: handle null property values in PP XML v69+#44
ma4nn merged 1 commit intoma4nn:masterfrom
dgehriger:fix/handle-null-property-values

Conversation

@dgehriger
Copy link
Copy Markdown
Contributor

Problem

Portfolio Performance v69+ can produce XML properties with empty/null text content. For example:

<properties>
  <entry>
    <string>portfolio-chart-details</string>
    <string/>
  </entry>
</properties>

This causes ppxml2db to pass None as the property value to the database, violating the NOT NULL constraint on property.value, resulting in:

sqlite3.IntegrityError: NOT NULL constraint failed: property.value

Users see:

CRITICAL unable to import the Portfolio Performance xml file "Portfolio.xml" (is it saved as "XML with ids"?)

Fix

Coalesce None property values to empty string "" in handle_toplevel_properties, consistent with how parse_configuration already handles this case.

Changes

  • patch_ppxml2db.diff: Updated patch to include the null-coalesce fix
  • tests/fixtures/empty_null_prop.ids.xml: New test fixture with a null property value
  • tests/data/test_pp_portfolio_builder.py: Added regression test

Portfolio Performance v69+ can produce properties with empty/null
values (e.g. portfolio-chart-details with no text content). The
ppxml2db parser was passing None to the DB, which violated the
NOT NULL constraint on the property.value column.

Coalesce None values to empty string, consistent with how
parse_configuration already handles this case.
@sonarqubecloud
Copy link
Copy Markdown

@ma4nn
Copy link
Copy Markdown
Owner

ma4nn commented Apr 14, 2026

Thanks for your contribution @dgehriger, much appreciated 🙏

@ma4nn ma4nn merged commit d88974e into ma4nn:master Apr 14, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants