Repository: openreview/openreview-py (language: python)

Issue:
ARR: Fix SAC max load cycle to use a number instead of free text string
Avoid process function errors, like this one: https://api2.openreview.net/logs/process?id=9jPQMQasc4




Discussion / hints:

Fix patch:
diff --git a/openreview/arr/management/setup_shared_data.py b/openreview/arr/management/setup_shared_data.py
index cd9c48018..16277034f 100644
--- a/openreview/arr/management/setup_shared_data.py
+++ b/openreview/arr/management/setup_shared_data.py
@@ -236,7 +236,7 @@ def _is_not_available(month: str, year: int, current_date: datetime.datetime, po
                 note.writers = [next_cycle_id, note.signatures[0]]
                 note.forum = next_load_invitation.edit['note']['forum']
                 note.replyto = next_load_invitation.edit['note']['replyto']
-                note.content['maximum_load_this_cycle'] = {'value': '0'}
+                note.content['maximum_load_this_cycle'] = {'value': 0 }
                 note.content['next_available_month'] = {'value': next_available_date[0]}
                 note.content['next_available_year'] = {'value': next_available_date[1]}
                 
diff --git a/openreview/stages/arr_content.py b/openreview/stages/arr_content.py
index 9ba71a120..e04d52b48 100644
--- a/openreview/stages/arr_content.py
+++ b/openreview/stages/arr_content.py
@@ -1806,9 +1806,9 @@
         "value": {
             "param": {
                 "input": "radio",
-                "enum": ["0", "4", "5", "6", "7", "8"],
+                "enum": [0, 4, 5, 6, 7, 8],
                 "optional": False,
-                "type": "string",
+                "type": "integer",
             }
         },
         "description": "Enter your maximum reviewing load for papers in this cycle. This refers only to the specific role mentioned at the top of this page. A load of '0' indicates you are unable to review new submissions.",
@@ -1887,9 +1887,9 @@
         "value": {
             "param": {
                 "input": "radio",
-                "enum": ["0", "6", "7", "8", "9", "10", "11", "12"],
+                "enum": [0, 6, 7, 8, 9, 10, 11, 12],
                 "optional": False,
-                "type": "string",
+                "type": "integer",
             }
         },
         "description": "Enter your maximum reviewing load for papers in this cycle. This refers only to the specific role mentioned at the top of this page. A load of '0' indicates you are unable to review new submissions.",
@@ -1899,7 +1899,10 @@
 del arr_sac_max_load_task["maximum_load_this_cycle_for_resubmissions"]
 arr_sac_max_load_task["maximum_load_this_cycle"] = {
     "value": {
-        "param": {"regex": "[0-9]{0,3}", "optional": False, "type": "string"}
+        "param": {
+            "optional": False,
+            "type": "integer"
+        }
     },
     "description": "Enter your maximum reviewing load for papers in this cycle. This refers only to the specific role mentioned at the top of this page. A load of '0' indicates you are unable to review new submissions.",
     "order": 1,


Test patch:
diff --git a/tests/test_arr_venue_v2.py b/tests/test_arr_venue_v2.py
index cd799fc86..99cc3a0df 100644
--- a/tests/test_arr_venue_v2.py
+++ b/tests/test_arr_venue_v2.py
@@ -781,7 +781,7 @@ def test_june_cycle(self, client, openreview_client, helpers, test_client, profi
             signatures=['~Reviewer_Alternate_ARROne1'],
             note=openreview.api.Note(
                 content = {
-                    'maximum_load_this_cycle': { 'value': '0' },
+                    'maximum_load_this_cycle': { 'value': 0 },
                     'maximum_load_this_cycle_for_resubmissions': { 'value': 'No' },
                     'meta_data_donation': { 'value': 'Yes, I consent to donating anonymous metadata of my review for research.' },
                     'next_available_month': { 'value': 'August'},
@@ -795,7 +795,7 @@ def test_june_cycle(self, client, openreview_client, helpers, test_client, profi
                 signatures=['~Reviewer_ARRTwo1'],
                 note=openreview.api.Note(
                     content = {
-                        'maximum_load_this_cycle': { 'value': '0' },
+                        'maximum_load_this_cycle': { 'value': 0 },
                         'maximum_load_this_cycle_for_resubmissions': { 'value': 'No' },
                         'meta_data_donation': { 'value': 'Yes, I consent to donating anonymous metadata of my review for research.' },
                         'next_available_month': { 'value': 'August'}
@@ -808,7 +808,7 @@ def test_june_cycle(self, client, openreview_client, helpers, test_client, profi
                 signatures=['~Reviewer_ARRTwo1'],
                 note=openreview.api.Note(
                     content = {
-                        'maximum_load_this_cycle': { 'value': '0' },
+                        'maximum_load_this_cycle': { 'value': 0 },
                         'maximum_load_this_cycle_for_resubmissions': { 'value': 'No' },
                         'meta_data_donation': { 'value': 'Yes, I consent to donating anonymous metadata of my review for research.' },
                         'next_available_year': { 'value': 2024}
@@ -820,7 +820,7 @@ def test_june_cycle(self, client, openreview_client, helpers, test_client, profi
                 signatures=['~Reviewer_ARRTwo1'],
                 note=openreview.api.Note(
                     content = {
-                        'maximum_load_this_cycle': { 'value': '0' },
+                        'maximum_load_this_cycle': { 'value': 0 },
                         'maximum_load_this_cycle_for_resubmissions': { 'value': 'No' },
                         'meta_data_donation': { 'value': 'Yes, I consent to donating anonymous metadata of my review for research.' },
                         'next_available_month': { 'value': 'September'},
@@ -833,7 +833,7 @@ def test_june_cycle(self, client, openreview_client, helpers, test_client, profi
                 signatures=['~Reviewer_ARRThree1'],
                 note=openreview.api.Note(
                     content = {
-                        'maximum_load_this_cycle': { 'value': '0' },
+                        'maximum_load_this_cycle': { 'value': 0 },
                         'maximum_load_this_cycle_for_resubmissions': { 'value': 'No' },
                         'meta_data_donation': { 'value': 'No, I do not consent to donating anonymous metadata of my review for research.' },
                         'next_available_month': { 'value': 'July'},
@@ -846,7 +846,7 @@ def test_june_cycle(self, client, openreview_client, helpers, test_client, profi
                 signatures=['~Reviewer_ARRFour1'],
                 note=openreview.api.Note(
                     content = {
-                        'maximum_load_this_cycle': { 'value': '0' },
+                        'maximum_load_this_cycle': { 'value': 0 },
                         'maximum_load_this_cycle_for_resubmissions': { 'value': 'No' },
                         'meta_data_donation': { 'value': 'Yes, I consent to donating anonymous metadata of my review for research.' },
                         'next_available_month': { 'value': 'August'},
@@ -859,7 +859,7 @@ def test_june_cycle(self, client, openreview_client, helpers, test_client, profi
                 signatures=['~Reviewer_ARRFive1'],
                 note=openreview.api.Note(
                     content = {
-                        'maximum_load_this_cycle': { 'value': '0' },
+                        'maximum_load_this_cycle': { 'value': 0 },
                         'maximum_load_this_cycle_for_resubmissions': { 'value': 'No' },
                         'meta_data_donation': { 'value': 'Yes, I consent to donating anonymous metadata of my review for research.' },
                         'next_available_month': { 'value': 'July'},
@@ -872,7 +872,7 @@ def test_june_cycle(self, client, openreview_client, helpers, test_client, profi
             signatures=['~AC_ARROne1'],
             note=openreview.api.Note(
                 content = {
-                    'maximum_load_this_cycle': { 'value': '0' },
+                    'maximum_load_this_cycle': { 'value': 0 },
                     'maximum_load_this_cycle_for_resubmissions': { 'value': 'No' },
                     'next_available_month': { 'value': 'August'},
                     'next_available_year': { 'value':  2024}
@@ -884,7 +884,7 @@ def test_june_cycle(self, client, openreview_client, helpers, test_client, profi
             signatures=['~SAC_ARROne1'],
             note=openreview.api.Note(
                 content = {
-                    'maximum_load_this_cycle': { 'value': '0' },
+                    'maximum_load_this_cycle': { 'value': 0 },
                     'next_available_month': { 'value': 'September'},
                     'next_available_year': { 'value':  2024}
                 }
@@ -1397,19 +1397,19 @@ def test_unavailability_process_functions(self, client, openreview_client, helpe
         august_reviewer_notes = pc_client_v2.get_all_notes(invitation=f"{august_venue.get_reviewers_id()}/-/{max_load_name}")
         assert len(august_reviewer_notes) == len(migrated_reviewers)
         assert set([note.signatures[0] for note in august_reviewer_notes]) == migrated_reviewers
-        assert all(note.content['maximum_load_this_cycle']['value'] == '0' for note in august_reviewer_notes)
+        assert all(note.content['maximum_load_this_cycle']['value'] == 0 for note in august_reviewer_notes)
 
         migrated_acs = {'~AC_ARROne1'}
         august_ac_notes = pc_client_v2.get_all_notes(invitation=f"{august_venue.get_area_chairs_id()}/-/{max_load_name}")
         assert len(august_ac_notes) == len(migrated_acs)
         assert set([note.signatures[0] for note in august_ac_notes]) == migrated_acs
-        assert all(note.content['maximum_load_this_cycle']['value'] == '0' for note in august_ac_notes)
+        assert all(note.content['maximum_load_this_cycle']['value'] == 0 for note in august_ac_notes)
 
         migrated_sacs = {'~SAC_ARROne1'}
         august_sacs_notes = pc_client_v2.get_all_notes(invitation=f"{august_venue.get_senior_area_chairs_id()}/-/{max_load_name}")
         assert len(august_sacs_notes) == len(migrated_sacs)
         assert set([note.signatures[0] for note in august_sacs_notes]) == migrated_sacs
-        assert all(note.content['maximum_load_this_cycle']['value'] == '0' for note in august_sacs_notes)
+        assert all(note.content['maximum_load_this_cycle']['value'] == 0 for note in august_sacs_notes)
 
         august_reviewer_edges = {o['id']['tail']: [j['weight'] for j in o['values']] for o in pc_client_v2.get_grouped_edges(invitation=f"{august_venue.get_reviewers_id()}/-/Custom_Max_Papers", groupby='tail', select='weight')}
         august_ac_edges = {o['id']['tail']: [j['weight'] for j in o['values']] for o in pc_client_v2.get_grouped_edges(invitation=f"{august_venue.get_area_chairs_id()}/-/Custom_Max_Papers", groupby='tail', select='weight')}
@@ -1444,7 +1444,7 @@ def test_unavailability_process_functions(self, client, openreview_client, helpe
                 signatures=['~Reviewer_Alternate_ARROne1'],
                 note=openreview.api.Note(
                     content = {
-                        'maximum_load_this_cycle': { 'value': '4' },
+                        'maximum_load_this_cycle': { 'value': 4 },
                         'maximum_load_this_cycle_for_resubmissions': { 'value': 'No' },
                         'meta_data_donation': { 'value': 'Yes, I consent to donating anonymous metadata of my review for research.' },
                     }
@@ -1455,7 +1455,7 @@ def test_unavailability_process_functions(self, client, openreview_client, helpe
             signatures=['~AC_ARRTwo1'],
             note=openreview.api.Note(
                 content = {
-                    'maximum_load_this_cycle': { 'value': '6' },
+                    'maximum_load_this_cycle': { 'value': 6 },
                     'maximum_load_this_cycle_for_resubmissions': { 'value': 'Yes' },
                 }
             )
@@ -1465,7 +1465,7 @@ def test_unavailability_process_functions(self, client, openreview_client, helpe
             signatures=['~SAC_ARRTwo1'],
             note=openreview.api.Note(
                 content = {
-                    'maximum_load_this_cycle': { 'value': '10' },
+                    'maximum_load_this_cycle': { 'value': 10 },
                 }
             )
         )
@@ -1491,7 +1491,7 @@ def test_unavailability_process_functions(self, client, openreview_client, helpe
                 note=openreview.api.Note(
                     id = reviewer_note_edit['note']['id'],
                     content = {
-                        'maximum_load_this_cycle': { 'value': '5' },
+                        'maximum_load_this_cycle': { 'value': 5 },
                         'maximum_load_this_cycle_for_resubmissions': { 'value': 'No' },
                         'meta_data_donation': { 'value': 'Yes, I consent to donating anonymous metadata of my review for research.' },
                     }
@@ -1503,7 +1503,7 @@ def test_unavailability_process_functions(self, client, openreview_client, helpe
             note=openreview.api.Note(
                 id = ac_note_edit['note']['id'],
                 content = {
-                    'maximum_load_this_cycle': { 'value': '7' },
+                    'maximum_load_this_cycle': { 'value': 7 },
                     'maximum_load_this_cycle_for_resubmissions': { 'value': 'Yes' }
                 }
             )
@@ -1514,7 +1514,7 @@ def test_unavailability_process_functions(self, client, openreview_client, helpe
             note=openreview.api.Note(
                 id = sac_note_edit['note']['id'],
                 content = {
-                    'maximum_load_this_cycle': { 'value': '11' }
+                    'maximum_load_this_cycle': { 'value': 11 }
                 }
             )
         )
@@ -1541,7 +1541,7 @@ def test_unavailability_process_functions(self, client, openreview_client, helpe
                     id = reviewer_note_edit['note']['id'],
                     ddate = openreview.tools.datetime_millis(now),
                     content = {
-                        'maximum_load_this_cycle': { 'value': '5' },
+                        'maximum_load_this_cycle': { 'value': 5 },
                         'maximum_load_this_cycle_for_resubmissions': { 'value': 'No' },
                         'meta_data_donation': { 'value': 'Yes, I consent to donating anonymous metadata of my review for research.' },
                     }
@@ -1554,7 +1554,7 @@ def test_unavailability_process_functions(self, client, openreview_client, helpe
                 id = ac_note_edit['note']['id'],
                 ddate = openreview.tools.datetime_millis(now),
                 content = {
-                    'maximum_load_this_cycle': { 'value': '7' },
+                    'maximum_load_this_cycle': { 'value': 7 },
                     'maximum_load_this_cycle_for_resubmissions': { 'value': 'Yes' }
                 }
             )
@@ -1566,7 +1566,7 @@ def test_unavailability_process_functions(self, client, openreview_client, helpe
                 id = sac_note_edit['note']['id'],
                 ddate = openreview.tools.datetime_millis(now),
                 content = {
-                    'maximum_load_this_cycle': { 'value': '11' }
+                    'maximum_load_this_cycle': { 'value': 11 }
                 }
             )
         )
@@ -1591,7 +1591,7 @@ def test_unavailability_process_functions(self, client, openreview_client, helpe
             signatures=['~Reviewer_ARRFive1'],
             note=openreview.api.Note(
                 content = {
-                    'maximum_load_this_cycle': { 'value': '0' },
+                    'maximum_load_this_cycle': { 'value': 0 },
                     'maximum_load_this_cycle_for_resubmissions': { 'value': 'Yes' },
                     'meta_data_donation': { 'value': 'Yes, I consent to donating anonymous metadata of my review for research.' },
                 }
@@ -1602,7 +1602,7 @@ def test_unavailability_process_functions(self, client, openreview_client, helpe
             signatures=['~AC_ARRThree1'],
             note=openreview.api.Note(
                 content = {
-                    'maximum_load_this_cycle': { 'value': '0' },
+                    'maximum_load_this_cycle': { 'value': 0 },
                     'maximum_load_this_cycle_for_resubmissions': { 'value': 'Yes' }
                 }
             )
@@ -1614,7 +1614,7 @@ def test_unavailability_process_functions(self, client, openreview_client, helpe
             signatures=['~AC_ARRTwo1'],
             note=openreview.api.Note(
                 content = {
-                    'maximum_load_this_cycle': { 'value': '6' },
+                    'maximum_load_this_cycle': { 'value': 6 },
                     'maximum_load_this_cycle_for_resubmissions': { 'value': 'Yes' }
                 }
             )
@@ -2737,9 +2737,9 @@ def test_resubmission_and_track_matching_data(self, client, openreview_client, h
         load_notes = pc_client_v2.get_all_notes(invitation='aclweb.org/ACL/ARR/2023/August/Reviewers/-/Max_Load_And_Unavailability_Request')
         for note in load_notes:
             if note.signatures[0] == '~Reviewer_ARRFive1':
-                assert cmp_edges[note.signatures[0]]['weight'] == int(note.content['maximum_load_this_cycle']['value']) + 1
+                assert cmp_edges[note.signatures[0]]['weight'] == note.content['maximum_load_this_cycle']['value'] + 1
                 continue
-            assert cmp_edges[note.signatures[0]]['weight'] == int(note.content['maximum_load_this_cycle']['value'])
+            assert cmp_edges[note.signatures[0]]['weight'] == note.content['maximum_load_this_cycle']['value']
 
         cmp_edges = {
             g['id']['tail'] : g['values'][0]
@@ -2748,9 +2748,9 @@ def test_resubmission_and_track_matching_data(self, client, openreview_client, h
         load_notes = pc_client_v2.get_all_notes(invitation='aclweb.org/ACL/ARR/2023/August/Area_Chairs/-/Max_Load_And_Unavailability_Request')
         for note in load_notes:
             if note.signatures[0] == '~AC_ARRThree1':
-                assert cmp_edges[note.signatures[0]]['weight'] == int(note.content['maximum_load_this_cycle']['value']) + 1
+                assert cmp_edges[note.signatures[0]]['weight'] == note.content['maximum_load_this_cycle']['value'] + 1
                 continue
-            assert cmp_edges[note.signatures[0]]['weight'] == int(note.content['maximum_load_this_cycle']['value'])
+            assert cmp_edges[note.signatures[0]]['weight'] == note.content['maximum_load_this_cycle']['value']
 
         # Check for seniority edges
         seniority_edges = {
@@ -3878,7 +3878,7 @@ def test_emergency_reviewing_forms(self, client, openreview_client, helpers):
             signatures=['~Reviewer_Alternate_ARROne1'],
             note=openreview.api.Note(
                 content = {
-                    'maximum_load_this_cycle': { 'value': '4' },
+                    'maximum_load_this_cycle': { 'value': 4 },
                     'maximum_load_this_cycle_for_resubmissions': { 'value': 'No' },
                     'meta_data_donation': { 'value': 'Yes, I consent to donating anonymous metadata of my review for research.' },
                 }