Skip to content

Commit f8437cd

Browse files
🛠️ apply pre-commit fixes
1 parent 9a0cc60 commit f8437cd

File tree

3 files changed

+31
-26
lines changed

3 files changed

+31
-26
lines changed

src/migrations/versions/b2a0463d9b91_migration.py

+30-21
Original file line numberDiff line numberDiff line change
@@ -5,42 +5,51 @@
55
Create Date: 2025-03-03 17:34:37.242326
66
77
"""
8-
from alembic import op
9-
import sqlalchemy as sa
108

9+
import sqlalchemy as sa
10+
from alembic import op
1111

1212
# revision identifiers, used by Alembic.
13-
revision = 'b2a0463d9b91'
14-
down_revision = 'e0fcdc14251c'
13+
revision = "b2a0463d9b91"
14+
down_revision = "e0fcdc14251c"
1515
branch_labels = None
1616
depends_on = None
1717

1818

1919
def upgrade():
2020
# ### commands auto generated by Alembic - please adjust! ###
21-
op.create_table('codegen_unit_test_generation_pr_context_to_run_id',
22-
sa.Column('id', sa.Integer(), nullable=False),
23-
sa.Column('provider', sa.String(), nullable=False),
24-
sa.Column('owner', sa.String(), nullable=False),
25-
sa.Column('pr_id', sa.BigInteger(), nullable=False),
26-
sa.Column('repo', sa.String(), nullable=False),
27-
sa.Column('run_id', sa.Integer(), nullable=False),
28-
sa.Column('iterations', sa.Integer(), nullable=False),
29-
sa.Column('original_pr_url', sa.String(), nullable=False),
30-
sa.ForeignKeyConstraint(['run_id'], ['run_state.id'], ondelete='CASCADE'),
31-
sa.PrimaryKeyConstraint('id'),
32-
sa.UniqueConstraint('provider', 'pr_id', 'repo', 'owner', 'original_pr_url')
21+
op.create_table(
22+
"codegen_unit_test_generation_pr_context_to_run_id",
23+
sa.Column("id", sa.Integer(), nullable=False),
24+
sa.Column("provider", sa.String(), nullable=False),
25+
sa.Column("owner", sa.String(), nullable=False),
26+
sa.Column("pr_id", sa.BigInteger(), nullable=False),
27+
sa.Column("repo", sa.String(), nullable=False),
28+
sa.Column("run_id", sa.Integer(), nullable=False),
29+
sa.Column("iterations", sa.Integer(), nullable=False),
30+
sa.Column("original_pr_url", sa.String(), nullable=False),
31+
sa.ForeignKeyConstraint(["run_id"], ["run_state.id"], ondelete="CASCADE"),
32+
sa.PrimaryKeyConstraint("id"),
33+
sa.UniqueConstraint("provider", "pr_id", "repo", "owner", "original_pr_url"),
3334
)
34-
with op.batch_alter_table('codegen_unit_test_generation_pr_context_to_run_id', schema=None) as batch_op:
35-
batch_op.create_index('ix_autofix_repo_owner_pr_id', ['owner', 'repo', 'pr_id', 'original_pr_url'], unique=False)
35+
with op.batch_alter_table(
36+
"codegen_unit_test_generation_pr_context_to_run_id", schema=None
37+
) as batch_op:
38+
batch_op.create_index(
39+
"ix_autofix_repo_owner_pr_id",
40+
["owner", "repo", "pr_id", "original_pr_url"],
41+
unique=False,
42+
)
3643

3744
# ### end Alembic commands ###
3845

3946

4047
def downgrade():
4148
# ### commands auto generated by Alembic - please adjust! ###
42-
with op.batch_alter_table('codegen_unit_test_generation_pr_context_to_run_id', schema=None) as batch_op:
43-
batch_op.drop_index('ix_autofix_repo_owner_pr_id')
49+
with op.batch_alter_table(
50+
"codegen_unit_test_generation_pr_context_to_run_id", schema=None
51+
) as batch_op:
52+
batch_op.drop_index("ix_autofix_repo_owner_pr_id")
4453

45-
op.drop_table('codegen_unit_test_generation_pr_context_to_run_id')
54+
op.drop_table("codegen_unit_test_generation_pr_context_to_run_id")
4655
# ### end Alembic commands ###

src/seer/automation/codegen/retry_unittest_step.py

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
AUTOFIX_EXECUTION_HARD_TIME_LIMIT_SECS,
99
AUTOFIX_EXECUTION_SOFT_TIME_LIMIT_SECS,
1010
)
11-
1211
from seer.automation.codebase.repo_client import RepoClientType
1312
from seer.automation.codegen.models import CodeUnitTestRequest
1413
from seer.automation.codegen.retry_unittest_coding_component import RetryUnitTestCodingComponent

src/seer/automation/codegen/unit_test_github_pr_creator.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@
55

66
from seer.automation.codebase.repo_client import RepoClient
77
from seer.automation.models import FileChange
8-
from seer.db import (
9-
DbPrContextToUnitTestGenerationRunIdMapping,
10-
Session,
11-
)
8+
from seer.db import DbPrContextToUnitTestGenerationRunIdMapping, Session
129

1310
logger = logging.getLogger(__name__)
1411

0 commit comments

Comments
 (0)