Skip to content

Commit

Permalink
remove now-unnecessary try block
Browse files Browse the repository at this point in the history
  • Loading branch information
taigrr committed Nov 28, 2024
1 parent eae1819 commit c8e8f5d
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions libs/checkpoint-postgres/langgraph/checkpoint/postgres/aio.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,17 @@ async def setup(self) -> None:
await cur.execute(
self.MIGRATIONS[0]
)
try:
results = await cur.execute(
"SELECT v FROM checkpoint_migrations ORDER BY v DESC LIMIT 1"
)
row = await results.fetchone()
if row is None:
version = -1
else:
version = row["v"]
except UndefinedTable:
await cur.execute(
self.MIGRATIONS[0]
)
results = await cur.execute(
"SELECT v FROM checkpoint_migrations ORDER BY v DESC LIMIT 1"
)
row = await results.fetchone()
if row is None:
version = -1
else:
version = row["v"]
for v, migration in zip(
range(version + 1, len(self.MIGRATIONS)),
self.MIGRATIONS[version + 1 :],
Expand Down

0 comments on commit c8e8f5d

Please sign in to comment.