Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Treat pivoted leaf import mapping correctly even when its position is set to header #257

Merged

Conversation

soininen
Copy link
Collaborator

@soininen soininen commented Aug 9, 2023

This PR fixes two bugs in import_mappings:

  • We should ignore leaf mapping's position even when it is to header if it actually should be pivoted.
  • We should not mappings as pivoted when only the leaf mapping is set to header

Fixes spine-tools/Spine-Toolbox#2224

@manuelma FYI: this touches some stuff that may conflict with the entity branch.

Checklist before merging

  • Documentation (also in Toolbox repo) is up-to-date
  • Release notes in Toolbox repo have been updated
  • Unit tests have been added/updated accordingly
  • Code has been formatted by black
  • Unit tests pass

Import mappings should ignore the position of last mapping if
the mappings are pivoted. This did not happen, however, when
one of the other mappings was marked as header and there were
no explicitly set pivoted mappings. We now take this special
case into account.

Re spine-tools/Spine-Toolbox#2224
Mappings are not pivoted when only the leaf mapping has position
set to header.

Re spine-tools/Spine-Toolbox#2224
@codecov-commenter
Copy link

codecov-commenter commented Aug 9, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.06% 🎉

Comparison is base (4168c30) 75.33% compared to head (f4272dd) 75.39%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #257      +/-   ##
==========================================
+ Coverage   75.33%   75.39%   +0.06%     
==========================================
  Files          76       76              
  Lines       10921    10921              
  Branches     2378     2378              
==========================================
+ Hits         8227     8234       +7     
+ Misses       2253     2246       -7     
  Partials      441      441              
Files Changed Coverage Δ
spinedb_api/import_mapping/generator.py 90.80% <100.00%> (ø)
spinedb_api/import_mapping/import_mapping.py 88.25% <100.00%> (+1.11%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@soininen soininen merged commit f50f7ba into master Aug 9, 2023
@soininen soininen deleted the toolbox_2224_fix_import_mappings_when_pivoted_by_header branch August 9, 2023 09:39
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.

Importer Pivoted Source Type can hide bugs
2 participants