diff --git a/cdd/compound/openapi/utils/emit_utils.py b/cdd/compound/openapi/utils/emit_utils.py index 934d7bbf..64c0032d 100644 --- a/cdd/compound/openapi/utils/emit_utils.py +++ b/cdd/compound/openapi/utils/emit_utils.py @@ -312,6 +312,7 @@ def generate_create_from_attr_staticmethod(params, cls_name, docstring_format): args=[], keywords=[ keyword( + arg=None, value=DictComp( key=Name(id="attr", ctx=Load()), value=Call( @@ -347,7 +348,8 @@ def generate_create_from_attr_staticmethod(params, cls_name, docstring_format): is_async=0, ) ], - ) + ), + identifier=None, ) ], expr=None, diff --git a/cdd/sqlalchemy/utils/shared_utils.py b/cdd/sqlalchemy/utils/shared_utils.py index 41d04bf3..0ff5b912 100644 --- a/cdd/sqlalchemy/utils/shared_utils.py +++ b/cdd/sqlalchemy/utils/shared_utils.py @@ -158,7 +158,7 @@ def update_args_infer_typ_sqlalchemy(_param, args, name, nullable, x_typ_sql): func=Name(type_name, Load()), args=list(map(set_value, x_typ_sql.get("type_args", iter(())))), keywords=[ - keyword(arg=arg, value=set_value(val)) + keyword(arg=arg, value=set_value(val), identifier=None) for arg, val in x_typ_sql.get("type_kwargs", dict()).items() ], expr=None, diff --git a/cdd/tests/mocks/fastapi_routes.py b/cdd/tests/mocks/fastapi_routes.py index 99cc30f4..683f7c7b 100644 --- a/cdd/tests/mocks/fastapi_routes.py +++ b/cdd/tests/mocks/fastapi_routes.py @@ -72,7 +72,9 @@ async def create_config(config: Config): func=Name(id="JSONResponse", ctx=Load()), args=[], keywords=[ - keyword(arg="status_code", value=set_value(404)), + keyword( + arg="status_code", value=set_value(404), identifier=None + ), keyword( arg="content", value=Dict( @@ -93,6 +95,7 @@ async def create_config(config: Config): ) ), ), + identifier=None, ), ], ) @@ -105,8 +108,12 @@ async def create_config(config: Config): func=Name(id="JSONResponse", ctx=Load()), args=[], keywords=[ - keyword(arg="status_code", value=set_value(201)), - keyword(arg="content", value=Name(id="config", ctx=Load())), + keyword(arg="status_code", value=set_value(201), identifier=None), + keyword( + arg="content", + value=Name(id="config", ctx=Load()), + identifier=None, + ), ], ) ), @@ -116,7 +123,11 @@ async def create_config(config: Config): func=Attribute(value=Name(id="app", ctx=Load()), attr="post", ctx=Load()), args=[set_value("/api/config")], keywords=[ - keyword(arg="response_model", value=Name(id="Config", ctx=Load())), + keyword( + arg="response_model", + value=Name(id="Config", ctx=Load()), + identifier=None, + ), keyword( arg="responses", value=Dict( @@ -138,6 +149,7 @@ async def create_config(config: Config): ), ], ), + identifier=None, ), ], ) diff --git a/cdd/tests/mocks/methods.py b/cdd/tests/mocks/methods.py index 8bf02f5d..c72dd451 100644 --- a/cdd/tests/mocks/methods.py +++ b/cdd/tests/mocks/methods.py @@ -890,7 +890,9 @@ def call_cliff( Name(id="total_loss", ctx=Load()), Name(id="num_present", ctx=Load()), ], - keywords=[keyword(arg="name", value=set_value("value"))], + keywords=[ + keyword(arg="name", value=set_value("value"), identifier=None) + ], ) ), ], diff --git a/cdd/tests/mocks/sqlalchemy.py b/cdd/tests/mocks/sqlalchemy.py index 3fd935e0..6fea1d2f 100644 --- a/cdd/tests/mocks/sqlalchemy.py +++ b/cdd/tests/mocks/sqlalchemy.py @@ -107,9 +107,13 @@ args=[set_value("dataset_name"), Name(ctx=Load(), id="String")], func=Name(ctx=Load(), id="Column"), keywords=[ - keyword(arg="comment", value=set_value("name of dataset")), - keyword(arg="default", value=set_value("mnist")), - keyword(arg="primary_key", value=set_value(True)), + keyword( + arg="comment", + value=set_value("name of dataset"), + identifier=None, + ), + keyword(arg="default", value=set_value("mnist"), identifier=None), + keyword(arg="primary_key", value=set_value(True), identifier=None), ], ), Call( @@ -119,9 +123,14 @@ keyword( arg="comment", value=set_value("directory to look for models in"), + identifier=None, ), - keyword(arg="default", value=set_value("~/tensorflow_datasets")), - keyword(arg="nullable", value=set_value(False)), + keyword( + arg="default", + value=set_value("~/tensorflow_datasets"), + identifier=None, + ), + keyword(arg="nullable", value=set_value(False), identifier=None), ], ), Call( @@ -130,7 +139,9 @@ Call( args=[set_value("np"), set_value("tf")], func=Name(ctx=Load(), id="Enum"), - keywords=[keyword(arg="name", value=set_value("K"))], + keywords=[ + keyword(arg="name", value=set_value("K"), identifier=None) + ], ), ], func=Name(ctx=Load(), id="Column"), @@ -138,9 +149,10 @@ keyword( arg="comment", value=set_value("backend engine, e.g., `np` or `tf`"), + identifier=None, ), - keyword(arg="default", value=set_value("np")), - keyword(arg="nullable", value=set_value(False)), + keyword(arg="default", value=set_value("np"), identifier=None), + keyword(arg="nullable", value=set_value(False), identifier=None), ], ), Call( @@ -148,9 +160,11 @@ func=Name(ctx=Load(), id="Column"), keywords=[ keyword( - arg="comment", value=set_value("Convert to numpy ndarrays") + arg="comment", + value=set_value("Convert to numpy ndarrays"), + identifier=None, ), - keyword(arg="nullable", value=set_value(True)), + keyword(arg="nullable", value=set_value(True), identifier=None), ], ), Call( @@ -162,6 +176,7 @@ value=set_value( "pass this as arguments to data_loader function" ), + identifier=None, ), keyword(arg="nullable", value=set_value(True)), ], @@ -172,6 +187,7 @@ keyword( arg="comment", value=set_value(docstring_header_and_return_two_nl_str), + identifier=None, ) ], ), @@ -372,7 +388,6 @@ def __repr__(self): name="__repr__", args=arguments( posonlyargs=[], - arg=None, args=[set_arg("self")], kwonlyargs=[], kw_defaults=[], @@ -624,6 +639,8 @@ def __repr__(self): kwonlyargs=[], kw_defaults=[], defaults=[], + vararg=None, + kwarg=None, ), body=[ Expr( @@ -633,7 +650,8 @@ def __repr__(self): partial(indent, prefix=tab * 2), ( "", - "Construct an instance from an object with identical columns (as attributes) as this `class`/`Table`", + "Construct an instance from an object with identical columns (as attributes)" + " as this `class`/`Table`", tab * 2, ":return: A new instance made from the input object's attributes", ":rtype: ```foo```", @@ -649,6 +667,7 @@ def __repr__(self): args=[], keywords=[ keyword( + arg=None, value=DictComp( key=Name(id="attr", ctx=Load()), value=Call( @@ -693,13 +712,14 @@ def __repr__(self): is_async=0, ) ], - ) + ), ) ], ) ), ], lineno=None, + returns=None, decorator_list=[Name(id="staticmethod", ctx=Load())], ) diff --git a/cdd/tests/test_compound/test_sync_properties.py b/cdd/tests/test_compound/test_sync_properties.py index 8cf36fb7..1f4aa7b8 100644 --- a/cdd/tests/test_compound/test_sync_properties.py +++ b/cdd/tests/test_compound/test_sync_properties.py @@ -159,12 +159,7 @@ def test_sync_properties_output_param_wrap_no_annotation(self) -> None: """Tests `sync_properties` with `output_param_wrap` set when type annotation isn't being replaced""" with TemporaryDirectory() as tempdir: - ( - input_filename, - input_str, - output_filename, - output_str, - ) = populate_files( + (input_filename, input_str, output_filename, output_str,) = populate_files( tempdir, input_str=( "from {package} import Literal\n\n" @@ -198,12 +193,7 @@ def test_sync_properties_output_param_wrap_no_type(self) -> None: """Tests `sync_properties` with `output_param_wrap` set when replacement_node has no type""" with TemporaryDirectory() as tempdir: - ( - input_filename, - input_str, - output_filename, - output_str, - ) = populate_files( + (input_filename, input_str, output_filename, output_str,) = populate_files( tempdir, output_str=( "from {package} import Literal\n\n" @@ -241,12 +231,7 @@ def test_sync_properties_output_param_wrap_subscript(self) -> None: """Tests `sync_properties` with `output_param_wrap` set when replacement_node is subscript and !input_eval""" with TemporaryDirectory() as tempdir: - ( - input_filename, - input_str, - output_filename, - output_str, - ) = populate_files( + (input_filename, input_str, output_filename, output_str,) = populate_files( tempdir, input_str="a = tuple(range(5))", output_str="def j(k):\n" "{tab}pass\n".format(tab=tab), @@ -274,12 +259,7 @@ def test_sync_properties_output_param_wrap_subscript_eval0(self) -> None: """Tests `sync_properties` with `output_param_wrap` set when replacement_node is subscript""" with TemporaryDirectory() as tempdir: - ( - input_filename, - input_str, - output_filename, - output_str, - ) = populate_files( + (input_filename, input_str, output_filename, output_str,) = populate_files( tempdir, input_str="a = tuple(range(5))", output_str="def j(k): pass" ) @@ -307,12 +287,7 @@ def test_sync_properties_output_param_wrap_subscript_eval1(self) -> None: """Tests `sync_properties` with `output_param_wrap` set when replacement_node is subscript""" with TemporaryDirectory() as tempdir: - ( - input_filename, - input_str, - output_filename, - output_str, - ) = populate_files( + (input_filename, input_str, output_filename, output_str,) = populate_files( tempdir, input_str="import pip\n" "c = { attr: getattr(pip, attr)" diff --git a/cdd/tests/test_sqlalchemy/test_emit_sqlalchemy_utils.py b/cdd/tests/test_sqlalchemy/test_emit_sqlalchemy_utils.py index 18a201da..449e7038 100644 --- a/cdd/tests/test_sqlalchemy/test_emit_sqlalchemy_utils.py +++ b/cdd/tests/test_sqlalchemy/test_emit_sqlalchemy_utils.py @@ -145,7 +145,7 @@ def test_param_to_sqlalchemy_column_call_when_sql_constraints(self) -> None: gold=Call( func=Name(id="Column", ctx=Load()), args=[Name(id="String", ctx=Load())], - keywords=[keyword(arg="index", value=set_value(True))], + keywords=[keyword(arg="index", value=set_value(True), identifier=None)], ), )