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

Remove unused imports #571

Merged
merged 7 commits into from Dec 7, 2020
Merged

Remove unused imports #571

merged 7 commits into from Dec 7, 2020

Conversation

michielderoos
Copy link
Contributor

Describe the Pull Request

Been playing with vulture, and thought I should do a super quick PR to get rid of some unused imports.

Todo

  • Link relevant trello card or related issue to the pull request
  • Request review from relevant @person or team
  • QA your pull request. This includes running the app, login, testing changes etc.
  • Bump backend and/or frontend versions following Semver

@michielderoos
Copy link
Contributor Author

Remove unused imports

@codecov
Copy link

codecov bot commented Dec 4, 2020

Codecov Report

Merging #571 (ca72c10) into master (75fc3c7) will decrease coverage by 0.04%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #571      +/-   ##
==========================================
- Coverage   47.23%   47.19%   -0.05%     
==========================================
  Files         338      337       -1     
  Lines       17589    17575      -14     
  Branches     1348     1348              
==========================================
- Hits         8309     8295      -14     
  Misses       9247     9247              
  Partials       33       33              
Flag Coverage Δ
javascript 4.76% <ø> (ø)
python 70.40% <100.00%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
app/server/api/transfer_usage_api.py 97.22% <ø> (-0.15%) ⬇️
app/server/models/organisation.py 94.78% <ø> (-0.05%) ⬇️
app/server/utils/amazon_s3.py 24.67% <ø> (-2.83%) ⬇️
app/server/utils/ussd/token_processor.py 86.41% <ø> (-0.09%) ⬇️
eth_worker/eth_src/celery_app.py 87.50% <ø> (ø)
...eth_manager/contract_registry/contract_registry.py 84.44% <ø> (-0.34%) ⬇️
app/server/utils/auth.py 83.64% <100.00%> (ø)
app/server/utils/metrics/filters.py 61.90% <100.00%> (-2.15%) ⬇️
config.py 82.96% <100.00%> (ø)
app/server/models/user.py 90.51% <0.00%> (-0.25%) ⬇️
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 75fc3c7...ca72c10. Read the comment docs.

Copy link
Contributor

@tristanhcole tristanhcole left a comment

Choose a reason for hiding this comment

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

went through manually - looks reasonable

a few comments, but otherwise lgtm

@@ -1,7 +1,6 @@
from flask import Blueprint, request, make_response, jsonify
from flask.views import MethodView
from sqlalchemy import desc
Copy link
Contributor

Choose a reason for hiding this comment

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

from sqlalchemy import desc is also unused it seems?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hm, vulture didn't pick those up for some reason. Will delete when I log on in the AM!

Copy link
Contributor

Choose a reason for hiding this comment

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

no worries!

@@ -1,12 +1,10 @@
import os
import shutil
import requests
import datetime
from flask import g, current_app
import boto3
Copy link
Contributor

Choose a reason for hiding this comment

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

import boto3 also unused

Comment on lines -150 to -172

transaction_volume_filters = [
CreditTransfer.transfer_status == TransferStatusEnum.COMPLETE,
]

standard_payment_filters = [
CreditTransfer.transfer_status == TransferStatusEnum.COMPLETE,
CreditTransfer.transfer_type == TransferTypeEnum.PAYMENT,
CreditTransfer.transfer_subtype == TransferSubTypeEnum.STANDARD
]

exchanged_filters = [
CreditTransfer.transfer_status == TransferStatusEnum.COMPLETE,
CreditTransfer.transfer_type == TransferTypeEnum.EXCHANGE,
]

beneficiary_filters = [User.has_beneficiary_role == True]
vendor_filters = [User.has_vendor_role == True]

exhaused_balance_filters = [
CreditTransfer.transfer_type == TransferTypeEnum.PAYMENT,
TransferAccount._balance_wei == 0
]
Copy link
Contributor

Choose a reason for hiding this comment

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

would these be used in future?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't imagine they will be.They're pretty self explanatory to rewrite if we do though IMO

Copy link
Contributor

Choose a reason for hiding this comment

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

ok!

@michielderoos michielderoos merged commit 58bb6e1 into master Dec 7, 2020
@michielderoos michielderoos deleted the remove-unused-imports branch December 7, 2020 13:27
enjeyw added a commit that referenced this pull request Dec 15, 2020
* master: (28 commits)
  Adding blockchain_task_uuid index to worker messages (#551)
  Make location lookup look at existing users' coordinates as a last resort (#555)
  Add support for Commcare (#569)
  Improve external transaction detection (#570)
  Remove unused imports (#571)
  Celo integration (#535)
  feat: small improvements to accessibility across the web app (#562)
  Group by Sender and Recipient (#567)
  Enable multiple chains (#496)
  Silence loading spinner warning (#568)
  Custom attribute bugfix (#549)
  Antify Message Bar (#566)
  Stop retrying infinitely (#565)
  Only update BlockchainTransaction on the worker when we absolutely have to (#564)
  Make SynchronizedBlock be updated in batch instead of one giant update (#563)
  Hide Filters and Groups (#558)
  adding more colors to charts, and tweaking legends (#561)
  Chart Tweaks (#560)
  Recipients filter (#533)
  Dynamic transfer card loaded (#559)
  ...

# Conflicts:
#	app/server/api/transfer_card_api.py
#	app/test_app/functional/api/test_transfer_card_api.py
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

2 participants