Skip to content

Commit

Permalink
[cdd/compound/exmod_utils.py] Fix support for Hybrid SQLalchemy ; [cd…
Browse files Browse the repository at this point in the history
…d/compound/openapi/utils/emit_utils.py] Scaffold to create multiple columns with `param_to_sqlalchemy_column_calls` ; [cdd/sqlalchemy/utils/shared_utils.py] Fix single elem union
  • Loading branch information
SamuelMarks committed Feb 4, 2024
1 parent b4f662c commit ca45f83
Show file tree
Hide file tree
Showing 23 changed files with 1,331 additions and 1,245 deletions.
10 changes: 5 additions & 5 deletions cdd/compound/exmod_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,11 +464,11 @@ def _emit_symbol(
**dict(
**{
"{emit_name}_name".format(
emit_name=(
"function"
if emit_name == "argparse"
else emit_name.replace("sqlalchemy_table", "table")
)
emit_name={
"argparse": "function",
"sqlalchemy_table": "table",
"sqlalchemy_hybrid": "table",
}.get(emit_name, emit_name)
): name
},
**{"function_type": "static"} if emit_name == "function" else {}
Expand Down
11 changes: 4 additions & 7 deletions cdd/compound/gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import cdd.compound.openapi.utils.emit_utils
import cdd.json_schema.emit
import cdd.shared.parse.utils.parser_utils
import cdd.sqlalchemy.utils.emit_utils
from cdd.compound.gen_utils import (
file_to_input_mapping,
gen_file,
Expand Down Expand Up @@ -91,15 +92,11 @@ def gen(
("sqlalchemy", "sqlalchemy_hybrid", "sqlalchemy_table")
):
if phase == 1:
return (
cdd.compound.openapi.utils.emit_utils.update_with_imports_from_columns(
output_filename
)
)
elif phase == 2:
return cdd.compound.openapi.utils.emit_utils.update_fk_for_file(
return cdd.sqlalchemy.utils.emit_utils.update_with_imports_from_columns(
output_filename
)
elif phase == 2:
return cdd.sqlalchemy.utils.emit_utils.update_fk_for_file(output_filename)
else:
raise NotImplementedError("phase {}".format(phase))
elif imports_from_file is None:
Expand Down
Loading

0 comments on commit ca45f83

Please sign in to comment.