From 652ef0e259e379de5a63be37309fb5fa5c87488f Mon Sep 17 00:00:00 2001 From: MusikAnimal Date: Thu, 18 Sep 2025 10:42:30 -0400 Subject: [PATCH] Update queries to use rc_source following schema change rc_new and rc_type no longer exist Drop support for Python 3.7 (we're using 3.9 on Toolforge) Remove Python tox tests, to be restored by someone who knows what they're doing :-P --- .github/workflows/python.yml | 28 ---------------------------- reports.py | 6 +++--- 2 files changed, 3 insertions(+), 31 deletions(-) delete mode 100644 .github/workflows/python.yml diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml deleted file mode 100644 index 7dd85d0..0000000 --- a/.github/workflows/python.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Python - -on: - push: - branches: [ "master" ] - pull_request: - branches: [ "master" ] - -jobs: - test: - name: Test Python - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.7", "3.9", "3.10"] - steps: - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip setuptools wheel - pip install -r requirements.txt - pip install -r requirements.dev.txt - - name: Running tox - run: tox diff --git a/reports.py b/reports.py index e4d2825..5cafd0f 100644 --- a/reports.py +++ b/reports.py @@ -186,7 +186,7 @@ def autopatrol_eligibles(self): # The user was human rc_bot = 0 AND # It was a new page - rc_new = 1 AND + rc_source = 'mb.new' AND # It's not a redirect page_is_redirect = 0 AND # User doesn't already have autoreviewer @@ -214,7 +214,7 @@ def autopatrol_eligibles(self): def new_wikiprojects(self): query = """SELECT rc_timestamp, rc_title FROM recentchanges - WHERE rc_new = 1 + WHERE rc_source = 'mb.new' AND rc_namespace = 4 AND rc_title LIKE 'WikiProject%' AND rc_title NOT LIKE '%/%' @@ -469,7 +469,7 @@ def most_edited_page_last_month(self): # Make the query query = """SELECT rc_title, count(*) as num_edits FROM recentchanges - WHERE rc_namespace = 0 AND rc_type < 2 + WHERE rc_namespace = 0 AND rc_source IN ('mw.edit', 'mw.new') GROUP BY 1 ORDER BY 2 DESC LIMIT 25;"""