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

Fix/missing measurement source (Sourcery refactored) #24

Conversation

sourcery-ai[bot]
Copy link
Contributor

@sourcery-ai sourcery-ai bot commented Jan 1, 2023

Pull Request #22 refactored by Sourcery.

If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.

NOTE: As code is pushed to the original Pull Request, Sourcery will
re-run and update (force-push) this Pull Request with new refactorings as
necessary. If Sourcery finds no refactorings at any point, this Pull Request
will be closed automatically.

See our documentation here.

Run Sourcery locally

Reduce the feedback loop during development by using the Sourcery editor plugin:

Review changes via command line

To manually merge these changes, make sure you're on the fix/missing_measurement_source branch, then run:

git fetch origin sourcery/fix/missing_measurement_source
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

@sourcery-ai sourcery-ai bot requested a review from mnbf9rca January 1, 2023 21:07
Comment on lines -81 to +84
missing_fields = []
for field in required_fields:
if field not in record:
missing_fields.append(field)

if missing_fields:
raise ValueError(f"Missing fields: {missing_fields}")
if missing_fields := [
field for field in required_fields if field not in record
]:
raise ValueError(f"Missing fields: {missing_fields}")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Function validate_all_fields_in_record refactored with the following changes:

@sourcery-ai
Copy link
Contributor Author

sourcery-ai bot commented Jan 1, 2023

Sourcery Code Quality Report

❌  Merging this PR will decrease code quality in the affected files by 0.57%.

Quality metrics Before After Change
Complexity 4.26 ⭐ 4.00 ⭐ -0.26 👍
Method Length 63.00 🙂 61.83 🙂 -1.17 👍
Working memory 5.39 ⭐ 5.62 ⭐ 0.23 👎
Quality 80.45% 79.88% -0.57% 👎
Other metrics Before After Change
Lines 113 110 -3
Changed files Quality Before Quality After Quality Change
shared_code/timescale.py 80.45% ⭐ 79.88% ⭐ -0.57% 👎

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Working Memory Quality Recommendation

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.


Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Help us improve this quality report!

@github-actions
Copy link

github-actions bot commented Jan 1, 2023

Coverage report

The coverage rate went from 99.04% to 100% ⬆️
The branch rate is 100%.

100% of new lines are covered.

Diff Coverage details (click to unfold)

shared_code/timescale.py

100% of new lines are covered (100% of the complete file).

@mnbf9rca mnbf9rca merged commit 805aba4 into fix/missing_measurement_source Jan 1, 2023
@mnbf9rca mnbf9rca deleted the sourcery/fix/missing_measurement_source branch January 1, 2023 21:09
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.

None yet

1 participant