File tree Expand file tree Collapse file tree 2 files changed +7
-14
lines changed
examples/sqlalchemy_type_annotations Expand file tree Collapse file tree 2 files changed +7
-14
lines changed Original file line number Diff line number Diff line change @@ -12,14 +12,11 @@ jobs:
1212 timeout-minutes : 10
1313
1414 steps :
15- - name : Check out the repo
16- uses : actions/checkout@v4
15+ - uses : actions/checkout@v4
1716 with :
1817 fetch-depth : 0
19- repository : ${{ github.event.pull_request.head.repo.full_name }}
20- ref : ${{ github.event.pull_request.head.ref }}
2118
22- - name : Setup backend
19+ - name : Setup
2320 id : setup
2421 uses : ./.github/actions/setup
2522
Original file line number Diff line number Diff line change 11import codegen
2+
3+
24from codegen import Codebase
35from codegen .sdk .core .detached_symbols .function_call import FunctionCall
46import subprocess
@@ -72,9 +74,7 @@ def run(codebase: Codebase):
7274 continue
7375
7476 # Check for nullable=True
75- is_nullable = any (
76- x .name == "nullable" and x .value == "True" for x in db_column_call .args
77- )
77+ is_nullable = any (x .name == "nullable" and x .value == "True" for x in db_column_call .args )
7878
7979 # Extract the first argument for the column type
8080 first_argument = db_column_call .args [0 ].source or ""
@@ -103,9 +103,7 @@ def run(codebase: Codebase):
103103
104104 # Add necessary imports
105105 if not cls .file .has_import ("Mapped" ):
106- cls .file .add_import_from_import_string (
107- "from sqlalchemy.orm import Mapped\n "
108- )
106+ cls .file .add_import_from_import_string ("from sqlalchemy.orm import Mapped\n " )
109107
110108 if "Optional" in new_type and not cls .file .has_import ("Optional" ):
111109 cls .file .add_import_from_import_string ("from typing import Optional\n " )
@@ -114,9 +112,7 @@ def run(codebase: Codebase):
114112 cls .file .add_import_from_import_string ("from decimal import Decimal\n " )
115113
116114 if "datetime" in new_type and not cls .file .has_import ("datetime" ):
117- cls .file .add_import_from_import_string (
118- "from datetime import datetime\n "
119- )
115+ cls .file .add_import_from_import_string ("from datetime import datetime\n " )
120116
121117 if class_modified :
122118 classes_modified += 1
You can’t perform that action at this time.
0 commit comments