File tree Expand file tree Collapse file tree 2 files changed +7
-14
lines changed
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
@@ -70,9 +72,7 @@ def run(codebase: Codebase):
7072 continue
7173
7274 # Check for nullable=True
73- is_nullable = any (
74- x .name == "nullable" and x .value == "True" for x in db_column_call .args
75- )
75+ is_nullable = any (x .name == "nullable" and x .value == "True" for x in db_column_call .args )
7676
7777 # Extract the first argument for the column type
7878 first_argument = db_column_call .args [0 ].source or ""
@@ -101,9 +101,7 @@ def run(codebase: Codebase):
101101
102102 # Add necessary imports
103103 if not cls .file .has_import ("Mapped" ):
104- cls .file .add_import_from_import_string (
105- "from sqlalchemy.orm import Mapped\n "
106- )
104+ cls .file .add_import_from_import_string ("from sqlalchemy.orm import Mapped\n " )
107105
108106 if "Optional" in new_type and not cls .file .has_import ("Optional" ):
109107 cls .file .add_import_from_import_string ("from typing import Optional\n " )
@@ -112,9 +110,7 @@ def run(codebase: Codebase):
112110 cls .file .add_import_from_import_string ("from decimal import Decimal\n " )
113111
114112 if "datetime" in new_type and not cls .file .has_import ("datetime" ):
115- cls .file .add_import_from_import_string (
116- "from datetime import datetime\n "
117- )
113+ cls .file .add_import_from_import_string ("from datetime import datetime\n " )
118114
119115 if class_modified :
120116 classes_modified += 1
You can’t perform that action at this time.
0 commit comments