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

#755 FIX unit component duplication BUG #756

Merged
merged 3 commits into from
Mar 9, 2023
Merged

Conversation

nimshi89
Copy link
Contributor

@nimshi89 nimshi89 commented Mar 8, 2023

#755 Bug was noticed during the work on #703.

@nimshi89 nimshi89 marked this pull request as ready for review March 8, 2023 12:02
@github-actions
Copy link

github-actions bot commented Mar 8, 2023

ubuntu-latest-python3.11 test results

506 tests  +1   506 ✔️ +1   3m 10s ⏱️ -8s
    9 suites ±0       0 💤 ±0 
    9 files   ±0       0 ±0 

Results for commit 84d2104. ± Comparison against base commit 768bdcf.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Mar 8, 2023

ubuntu-latest-python3.9 test results

506 tests  +1   506 ✔️ +1   3m 7s ⏱️ -16s
    9 suites ±0       0 💤 ±0 
    9 files   ±0       0 ±0 

Results for commit 84d2104. ± Comparison against base commit 768bdcf.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Mar 8, 2023

windows-latest-python3.11 test results

  10 files  ±0    11 suites  ±0   7m 40s ⏱️ +27s
520 tests +1  520 ✔️ +1  0 💤 ±0  0 ±0 
533 runs  +1  533 ✔️ +1  0 💤 ±0  0 ±0 

Results for commit 84d2104. ± Comparison against base commit 768bdcf.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@NickPapONS NickPapONS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! All I would do is tell sonarcloud that the "Existing Dimension Component" used in the new unit test is not an issue so the code smell disappears.

) -> List[rdf.qb.AttributeComponentSpecification]:
if self._units_component_already_defined:
# Don't define a second units component, the first one will work just fine.
return []
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add some debug logging here so we can track that we're avoiding serialising a second units component?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

        self, column_name_uri_safe: str
    ) -> List[rdf.qb.AttributeComponentSpecification]:
        if self._units_component_already_defined:
            _logger.debug(
                "The component type has already been serialised, %s.",
                column_name_uri_safe,
            )
            # Don't define a second units component, the first one will work just fine.

            return []```

is this the right place for it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's definitely the right place, but could it say something like Units component already generated. Not generating a second one.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah cool I'll sort it out

tests/unit/writers/qbwriter/test_dsdtordfmodelshelper.py Outdated Show resolved Hide resolved
@sonarcloud
Copy link

sonarcloud bot commented Mar 9, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@nimshi89 nimshi89 merged commit 0d9e1df into main Mar 9, 2023
@nimshi89 nimshi89 deleted the #755-unit-column-duplication branch March 9, 2023 14:33
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.

3 participants