Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump black from 23.1.0 to 24.3.0 #593

Merged
merged 5 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
postgres_version: ['12', '13', '14']
postgres_version: ['14']
services:
postgres:
image: postgres:${{ matrix.postgres_version }}
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pytest-asyncio==0.21.0
flake8==6.0.0
responses==0.23.1
mypy==1.1.1
black==23.1.0
black==24.3.0
isort==5.12.0
pre-commit==3.2.0
freezegun==1.2.2
1 change: 1 addition & 0 deletions scripts/migrate_to_rapidpro/retry_requests.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Looks for any failed requests, and retries them
"""

import asyncio
import json
import sys
Expand Down
65 changes: 65 additions & 0 deletions scripts/rapidpro/expire_flow_runs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
from csv import DictReader

# AND (fr.session_id is null or fr.parent_uuid is null)
# They're not linked to anything and the golang task just updates them.
FILE = "expired_runs4.csv"

input_file = DictReader(open(FILE))

run_ids = []
session_ids = []
for row in input_file:
run_ids.append(row["run_id"])

if row["session_id"]:
session_ids.append(row["session_id"])


print(len(run_ids))
print(len(session_ids))

print(
f"""UPDATE
flows_flowsession s
SET
timeout_on = NULL,
ended_on = NOW(),
status = 'X'
WHERE
id = ANY(ARRAY[{",".join(session_ids)}])
"""
)

# print(f"""UPDATE
# flows_flowrun fr
# SET
# is_active = FALSE,
# exited_on = NOW(),
# exit_type = 'E',
# status = 'E',
# modified_on = NOW()
# WHERE
# id = ANY(ARRAY[{",".join(run_ids)}])
# """)

"""
UPDATE
flows_flowrun fr
SET
is_active = FALSE,
exited_on = NOW(),
exit_type = 'E',
status = 'E',
modified_on = NOW()
WHERE
id = ANY(ARRAY[80689]);

UPDATE
flows_flowsession s
SET
timeout_on = NULL,
ended_on = NOW(),
status = 'X'
WHERE
id = ANY(ARRAY[26641])
"""
Loading