-
Notifications
You must be signed in to change notification settings - Fork 846
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
Handling database engines in the CLI #2721
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
pylint
augur/application/cli/db.py|396| C0116: Missing function or method docstring (missing-function-docstring)
augur/application/cli/user.py|15 col 1| W0511: TODO: Update these commands to use cli DatabaseContext so this engine is cleaned up (fixme)
augur/application/cli/__init__.py
Outdated
@@ -72,6 +73,22 @@ def new_func(ctx, *args, **kwargs): | |||
|
|||
return update_wrapper(new_func, function_db_connection) | |||
|
|||
|
|||
class DatabaseContext(object): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[pylint] reported by reviewdog 🐶
C0115: Missing class docstring (missing-class-docstring)
augur/application/cli/__init__.py
Outdated
@@ -72,6 +73,22 @@ def new_func(ctx, *args, **kwargs): | |||
|
|||
return update_wrapper(new_func, function_db_connection) | |||
|
|||
|
|||
class DatabaseContext(object): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[pylint] reported by reviewdog 🐶
R0205: Class 'DatabaseContext' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance)
augur/application/cli/__init__.py
Outdated
@@ -72,6 +73,22 @@ def new_func(ctx, *args, **kwargs): | |||
|
|||
return update_wrapper(new_func, function_db_connection) | |||
|
|||
|
|||
class DatabaseContext(object): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[pylint] reported by reviewdog 🐶
R0903: Too few public methods (0/2) (too-few-public-methods)
def __init__(self): | ||
self.engine = None | ||
|
||
def with_database(f): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[pylint] reported by reviewdog 🐶
C0116: Missing function or method docstring (missing-function-docstring)
def cli(): | ||
pass | ||
@click.pass_context | ||
def cli(ctx): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[pylint] reported by reviewdog 🐶
C0116: Missing function or method docstring (missing-function-docstring)
def add_github_org(organization_name): | ||
@with_database | ||
@click.pass_context | ||
def add_github_org(ctx, organization_name): | ||
""" | ||
Create new repo groups in Augur's database | ||
""" | ||
from augur.tasks.github.util.github_task_session import GithubTaskSession | ||
from augur.util.repo_load_controller import RepoLoadController |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[pylint] reported by reviewdog 🐶
C0415: Import outside toplevel (augur.util.repo_load_controller.RepoLoadController) (import-outside-toplevel)
def get_api_key(): | ||
@with_database | ||
@click.pass_context | ||
def get_api_key(ctx): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[pylint] reported by reviewdog 🐶
C0116: Missing function or method docstring (missing-function-docstring)
@test_db_connection | ||
@with_database | ||
@click.pass_context | ||
def reset_repo_age(ctx): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[pylint] reported by reviewdog 🐶
C0116: Missing function or method docstring (missing-function-docstring)
|
||
session.execute(update_query) | ||
session.commit() | ||
|
||
@cli.command("test-connection") | ||
@test_connection | ||
@test_db_connection | ||
def test_db_connection(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[pylint] reported by reviewdog 🐶
C0116: Missing function or method docstring (missing-function-docstring)
|
||
session.execute(update_query) | ||
session.commit() | ||
|
||
@cli.command("test-connection") | ||
@test_connection | ||
@test_db_connection | ||
def test_db_connection(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[pylint] reported by reviewdog 🐶
E0102: function already defined line 15 (function-redefined)
@@ -72,6 +73,22 @@ def new_func(ctx, *args, **kwargs): | |||
|
|||
return update_wrapper(new_func, function_db_connection) | |||
|
|||
|
|||
class DatabaseContext(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[pylint] reported by reviewdog 🐶
C0115: Missing class docstring (missing-class-docstring)
@@ -72,6 +73,22 @@ def new_func(ctx, *args, **kwargs): | |||
|
|||
return update_wrapper(new_func, function_db_connection) | |||
|
|||
|
|||
class DatabaseContext(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[pylint] reported by reviewdog 🐶
R0903: Too few public methods (0/2) (too-few-public-methods)
@cli.command("test-connection") | ||
@test_connection | ||
@test_db_connection | ||
def test_db_connection(): | ||
pass | ||
print("Successful db connection") | ||
|
||
|
||
# TODO: Fix this function | ||
def run_psql_command_in_database(target_type, target): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[pylint] reported by reviewdog 🐶
C0116: Missing function or method docstring (missing-function-docstring)
@@ -12,7 +12,7 @@ | |||
from augur.application.db.engine import DatabaseEngine | |||
from sqlalchemy.orm import sessionmaker | |||
|
|||
|
|||
# TODO: Update these commands to use cli DatabaseContext so this engine is cleaned up |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[pylint] reported by reviewdog 🐶
W0511: TODO: Update these commands to use cli DatabaseContext so this engine is cleaned up (fixme)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
Signed commits