Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jun 24, 2024
1 parent 187fe16 commit e874e0e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
10 changes: 5 additions & 5 deletions api/app/routers/entities_mrg.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ async def create_or_update_professionals(

# Index by ID_SUS
professionals_indexed = {
p.id_profissional_sus: p.dict(exclude_none=True)
p.id_profissional_sus: p.dict(exclude_none=True)
for p in professionals
}

Expand All @@ -236,7 +236,7 @@ async def create_or_update_professionals(
professional['name'] = professional.pop('nome')
professionals_inserts.append(HealthCareProfessional(**professional))
await HealthCareProfessional.bulk_create(
professionals_inserts,
professionals_inserts,
batch_size=500,
on_conflict=["id_sus"],
update_fields=["name", "cpf","cns"]
Expand All @@ -258,7 +258,7 @@ async def create_or_update_professionals(
)
)
await HealthCareProfessionalOccupation.bulk_create(
occupation_inserts,
occupation_inserts,
batch_size=500,
ignore_conflicts=True
)
Expand All @@ -276,9 +276,9 @@ async def create_or_update_professionals(
)
)
await ProfessionalRegistry.bulk_create(
registry_inserts,
registry_inserts,
batch_size=500,
ignore_conflicts=True
)

return len(professionals)
1 change: 1 addition & 0 deletions api/migrations/app/17_20240624185604_update.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
from tortoise import BaseDBAsyncClient


Expand Down
1 change: 1 addition & 0 deletions api/migrations/app/18_20240624191424_update.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
from tortoise import BaseDBAsyncClient


Expand Down

0 comments on commit e874e0e

Please sign in to comment.