Skip to content

Commit

Permalink
Formatting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
drobison00 committed Jul 12, 2023
1 parent 9fc7c14 commit e7b4c6b
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 19 deletions.
2 changes: 1 addition & 1 deletion morpheus/loaders/sql_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@


def try_parse_query_data(
query_data: typing.Dict[str, typing.Union[str, typing.Optional[typing.Dict[str, typing.Any]]]]
query_data: typing.Dict[str, typing.Union[str, typing.Optional[typing.Dict[str, typing.Any]]]]
) -> typing.Dict[str, typing.Union[str, typing.Optional[typing.Dict[str, typing.Any]]]]:
"""
Parses a dictionary of query data.
Expand Down
1 change: 1 addition & 0 deletions morpheus/utils/control_message_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ def cm_default_failure_context_manager(raise_on_failure: bool = False) -> typing
"""

def decorator(func):

@wraps(func)
def wrapper(control_messsage: ControlMessage, *args, **kwargs):
with CMDefaultFailureContextManager(control_message=control_messsage,
Expand Down
1 change: 0 additions & 1 deletion morpheus/utils/execution_chain.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import inspect
import typing


# def execution_chain_annotations(*annotations):
# def inner_annotate(func):
# def wrapper(*args, **kwargs):
Expand Down
5 changes: 4 additions & 1 deletion tests/modules/test_morpheus_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

# pylint: disable=unused-import
import morpheus.modules # noqa: F401

from morpheus import messages
from morpheus.utils.module_ids import FILTER_CM_FAILED

Expand Down Expand Up @@ -73,6 +72,7 @@ def test_get_module():


def test_get_module_with_bad_config_no_loaders():

def init_wrapper(builder: mrc.Builder):

def gen_data():
Expand Down Expand Up @@ -109,6 +109,7 @@ def gen_data():


def test_get_module_with_bad_loader_type():

def init_wrapper(builder: mrc.Builder):

def gen_data():
Expand Down Expand Up @@ -143,6 +144,7 @@ def gen_data():


def test_get_module_with_bad_control_message():

def init_wrapper(builder: mrc.Builder):

def gen_data():
Expand Down Expand Up @@ -349,6 +351,7 @@ def test_filter_cm_failed():
PACKETS_RECEIVED = 0

def init_wrapper(builder: mrc.Builder):

def gen_data():
msg = messages.ControlMessage()
msg.set_metadata("cm_failed", "true")
Expand Down
2 changes: 1 addition & 1 deletion tests/modules/test_morpheus_modules_with_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@

import cudf

from morpheus import messages
# pylint: disable=unused-import
import morpheus.modules # noqa: F401
from morpheus import messages
from morpheus.utils.module_ids import FILTER_CM_FAILED

from .morpheus_module_test_pipeline import MorpheusModuleTestPipeline
Expand Down
1 change: 1 addition & 0 deletions tests/utils/test_execution_chain.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def test_replace_function():


def test_nested_execution_chain():

def inner_func1(arg1, arg2) -> dict:
return {'result': arg1 + arg2}

Expand Down
30 changes: 15 additions & 15 deletions tests/utils/test_sql_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,33 +99,33 @@ def test_insert_data(sql_utils, mock_connection):
[
# Valid configurations
({
"drivername": "postgres+psycopg2", "host": "localhost", "database": "mydb"
},
"drivername": "postgres+psycopg2", "host": "localhost", "database": "mydb"
},
"postgres+psycopg2://localhost/mydb",
None),
# Valid configurations
({
"drivername": "mysql+pymysql",
"host": "localhost",
"port": 3306,
"database": "mydb",
"username": "user",
"password": "password"
},
"drivername": "mysql+pymysql",
"host": "localhost",
"port": 3306,
"database": "mydb",
"username": "user",
"password": "password"
},
"mysql+pymysql://user:password@localhost:3306/mydb",
None),
# Missing drivername
({
"host": "localhost", "database": "mydb"
}, None, RuntimeError("Must specify SQL drivername, ex. 'sqlite'")),
"host": "localhost", "database": "mydb"
}, None, RuntimeError("Must specify SQL drivername, ex. 'sqlite'")),
# Missing host and database
({
"drivername": "postgres+psycopg2"
}, None, RuntimeError("Must specify 'host' or 'database'")),
"drivername": "postgres+psycopg2"
}, None, RuntimeError("Must specify 'host' or 'database'")),
# Missing username or password
({
"drivername": "mysql+pymysql", "host": "localhost", "port": 3306, "database": "mydb", "username": "user"
},
"drivername": "mysql+pymysql", "host": "localhost", "port": 3306, "database": "mydb", "username": "user"
},
None,
RuntimeError("Must include both 'username' and 'password' or neither")),
])
Expand Down

0 comments on commit e7b4c6b

Please sign in to comment.