Skip to content

Commit 85cc47d

Browse files
committed
style: fix linting issues with sqlmodel AutoString usage
1 parent afdd27a commit 85cc47d

3 files changed

Lines changed: 17 additions & 16 deletions

File tree

backend/migrations/versions/66db43bbbd2b_init.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,32 +25,32 @@ def upgrade() -> None:
2525
op.create_table(
2626
"feed",
2727
sa.Column("id", sa.Integer(), nullable=False),
28-
sa.Column("url", sqlmodel.sql.sqltypes.AutoString(), nullable=False),
29-
sa.Column("title", sqlmodel.sql.sqltypes.AutoString(), nullable=False),
30-
sa.Column("logo", sqlmodel.sql.sqltypes.AutoString(), nullable=True),
31-
sa.Column("description", sqlmodel.sql.sqltypes.AutoString(), nullable=False),
32-
sa.Column("language", sqlmodel.sql.sqltypes.AutoString(), nullable=True),
28+
sa.Column("url", sqlmodel.sql.sqltypes.AutoString(), nullable=False), # type: ignore[attr-defined]
29+
sa.Column("title", sqlmodel.sql.sqltypes.AutoString(), nullable=False), # type: ignore[attr-defined]
30+
sa.Column("logo", sqlmodel.sql.sqltypes.AutoString(), nullable=True), # type: ignore[attr-defined]
31+
sa.Column("description", sqlmodel.sql.sqltypes.AutoString(), nullable=False), # type: ignore[attr-defined]
32+
sa.Column("language", sqlmodel.sql.sqltypes.AutoString(), nullable=True), # type: ignore[attr-defined]
3333
sa.Column("updated", sa.DateTime(), nullable=False),
3434
sa.PrimaryKeyConstraint("id"),
3535
sa.UniqueConstraint("url"),
3636
)
3737
op.create_table(
3838
"user",
39-
sa.Column("id", sqlmodel.sql.sqltypes.AutoString(), nullable=False),
39+
sa.Column("id", sqlmodel.sql.sqltypes.AutoString(), nullable=False), # type: ignore[attr-defined]
4040
sa.Column("first_request", sa.DateTime(), nullable=False),
4141
sa.Column("last_request", sa.DateTime(), nullable=False),
4242
sa.PrimaryKeyConstraint("id"),
4343
)
4444
op.create_table(
4545
"article",
4646
sa.Column("id", sa.Integer(), nullable=False),
47-
sa.Column("title", sqlmodel.sql.sqltypes.AutoString(), nullable=False),
48-
sa.Column("description", sqlmodel.sql.sqltypes.AutoString(), nullable=False),
49-
sa.Column("url", sqlmodel.sql.sqltypes.AutoString(), nullable=False),
50-
sa.Column("comments_url", sqlmodel.sql.sqltypes.AutoString(), nullable=True),
47+
sa.Column("title", sqlmodel.sql.sqltypes.AutoString(), nullable=False), # type: ignore[attr-defined]
48+
sa.Column("description", sqlmodel.sql.sqltypes.AutoString(), nullable=False), # type: ignore[attr-defined]
49+
sa.Column("url", sqlmodel.sql.sqltypes.AutoString(), nullable=False), # type: ignore[attr-defined]
50+
sa.Column("comments_url", sqlmodel.sql.sqltypes.AutoString(), nullable=True), # type: ignore[attr-defined]
5151
sa.Column("pub_date", sa.DateTime(), nullable=True),
5252
sa.Column("updated", sa.DateTime(), nullable=False),
53-
sa.Column("embedding", sqlmodel.sql.sqltypes.AutoString(), nullable=True),
53+
sa.Column("embedding", sqlmodel.sql.sqltypes.AutoString(), nullable=True), # type: ignore[attr-defined]
5454
sa.Column("feed_id", sa.Integer(), nullable=False),
5555
sa.ForeignKeyConstraint(
5656
["feed_id"],

backend/migrations/versions/8238936297a1_add_user_clusters_and_mising_datetime_.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ def upgrade() -> None:
5151
),
5252
)
5353
op.add_column(
54-
"user", sa.Column("clusters", sqlmodel.sql.sqltypes.AutoString(), nullable=True)
54+
"user",
55+
sa.Column("clusters", sqlmodel.sql.sqltypes.AutoString(), nullable=True), # type: ignore[attr-defined]
5556
)
5657
op.add_column(
5758
"user", sa.Column("clusters_updated_at", sa.DateTime(), nullable=True)

backend/tests/models/test_feed.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ def test_generate_feed(self):
5353
assert articles[0].title in generated_feed
5454
assert articles[1].title in generated_feed
5555

56-
LOG_URL_PREFIX: str = f"{API_BASE_URL}/{ROOT_PATH}/v1/log/{user_id}/"
57-
FEED_URL_PREFIX: str = f"{API_BASE_URL}/{ROOT_PATH}/v1/feed/{user_id}/"
56+
log_url_prefix: str = f"{API_BASE_URL}/{ROOT_PATH}/v1/log/{user_id}/"
57+
feed_url_prefix: str = f"{API_BASE_URL}/{ROOT_PATH}/v1/feed/{user_id}/"
5858

5959
matches = re.findall(
6060
r'href=["\']([^"\']+)["\']|<link>([^<]+)</link>|<comments>([^<]+)</comments>',
@@ -69,8 +69,8 @@ def test_generate_feed(self):
6969
links_without_log_url_prefix = [
7070
link
7171
for link in links
72-
if not link.startswith(LOG_URL_PREFIX)
73-
and not link.startswith(FEED_URL_PREFIX)
72+
if not link.startswith(log_url_prefix)
73+
and not link.startswith(feed_url_prefix)
7474
]
7575

7676
assert not links_without_log_url_prefix, links_without_log_url_prefix

0 commit comments

Comments
 (0)