Skip to content

Commit

Permalink
solved the error
Browse files Browse the repository at this point in the history
  • Loading branch information
Mahamudul42 authored and karlhigley committed Jan 15, 2025
1 parent 5ecb8fc commit 88bbeec
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ repos:
- id: ruff
args: [--fix]
name: auto-fix Python lint errors
# Run the formatter.
- id: ruff-format
# Run the formatter.
name: format Python source
exclude: ^poprox-db/migrations/versions
- repo: local
Expand All @@ -42,8 +42,8 @@ repos:
language: node
additional_dependencies:
- "@taplo/cli"
# shfmt support, adapted from https://github.com/mvdan/sh/issues/818
- id: format-shell-scripts
# shfmt support, adapted from https://github.com/mvdan/sh/issues/818
name: format shell scripts
language: golang
require_serial: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa

from alembic import op

# revision identifiers, used by Alembic.
revision: str = 'c2007fa35fc2'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def upgrade() -> None:
op.create_unique_constraint(
"uq_article_image_associations",
"article_image_associations",
("article_id", "image_id")
("article_id", "image_id"),
)


Expand Down
7 changes: 3 additions & 4 deletions src/poprox_storage/repositories/articles.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
)
from tqdm import tqdm

from poprox_concepts import Article, Entity, Image, Mention
from poprox_concepts import Article, Entity, Mention
from poprox_storage.aws import DEV_BUCKET_NAME, s3
from poprox_storage.repositories.data_stores.db import DatabaseRepository
from poprox_storage.repositories.data_stores.s3 import S3Repository
Expand Down Expand Up @@ -213,11 +213,10 @@ def store_articles(self, articles: list[Article], *, mentions=False, progress=Fa
failed += 1

return failed

def store_image_association(self, article_id: str, image_id: str):
associations_table = self.tables["article_image_associations"]
insert_stmt = insert(associations_table).values({"article_id": article_id, "image_id": image_id
})
insert_stmt = insert(associations_table).values({"article_id": article_id, "image_id": image_id})
self.conn.execute(insert_stmt)

def store_article(self, article: Article) -> UUID | None:
Expand Down

0 comments on commit 88bbeec

Please sign in to comment.