From 111929510d7a4982c1cc28cb54dc4a6d05076d6d Mon Sep 17 00:00:00 2001 From: Dragon Dave McKee Date: Wed, 13 Mar 2024 15:58:41 +0000 Subject: [PATCH] Disable enrichment queue 2024-03-13: Disabled this function in order to make sure that documents were not being sent to enrichment (and therefore locked) before editors had a chance to edit them. We intend to revisit this decision later so keeping the code intact makes sense. --- .../commands/enrich_next_in_reenrichment_queue.py | 8 ++++++++ judgments/tests/test_commands.py | 3 +++ pyproject.toml | 10 +++++----- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/judgments/management/commands/enrich_next_in_reenrichment_queue.py b/judgments/management/commands/enrich_next_in_reenrichment_queue.py index 39cb4f186..b5b0f1aee 100644 --- a/judgments/management/commands/enrich_next_in_reenrichment_queue.py +++ b/judgments/management/commands/enrich_next_in_reenrichment_queue.py @@ -10,6 +10,14 @@ class Command(BaseCommand): help = "Sends the next document in the re-enrichment queue to be enriched" def handle(self, *args, **options): + """ + 2024-03-13: Disabled this function in order to make sure that documents were not being sent to enrichment + (and therefore locked) before editors had a chance to edit them. We intend to revisit this decision later + so keeping the code intact makes sense. + """ + self.stdout.write("enrich_next_in_reenrichment_queue.py: currently disabled") + return + target_enrichment_version = api_client.get_highest_enrichment_version() target_parser_version = api_client.get_highest_parser_version() diff --git a/judgments/tests/test_commands.py b/judgments/tests/test_commands.py index 8f21049fd..5fcc6f055 100644 --- a/judgments/tests/test_commands.py +++ b/judgments/tests/test_commands.py @@ -1,11 +1,13 @@ from unittest.mock import call, patch +import pytest from django.core.management import call_command from django.test import TestCase from factories import DocumentFactory class CommandsTestCase(TestCase): + @pytest.mark.xfail(reason="disabled reenrichment queue") @patch("judgments.management.commands.enrich_next_in_reenrichment_queue.api_client") @patch( "judgments.management.commands.enrich_next_in_reenrichment_queue.NUMBER_TO_ENRICH", @@ -32,6 +34,7 @@ def test_enrich_next_in_reenrichment_queue(self, mock_api_client): document_1.enrich.assert_called_once() document_2.enrich.assert_called_once() + @pytest.mark.xfail(reason="disabled reenrichment queue") @patch("judgments.management.commands.enrich_next_in_reenrichment_queue.api_client") @patch( "judgments.management.commands.enrich_next_in_reenrichment_queue.NUMBER_TO_ENRICH", diff --git a/pyproject.toml b/pyproject.toml index b2abd83f5..d8ff55420 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,6 +8,8 @@ indent=2 custom_blocks="flag" [tool.ruff] + +[tool.ruff.lint] ignore = ["E501", "G004", "PLR2004", "RUF005", "RUF012", "UP040"] # long lines, fstrings in logs, magic values, consider not concat, mutable classbits, type instead of TypeAlias extend-select = ["W", "B", "Q", "C90", "I", "UP", "YTT", "ASYNC", "S", "BLE", "A", "COM", "C4", "DTZ", "T10", "DJ", "EM", "EXE", "FA", "ISC", "ICN", "G", "INP", "PIE", "T20", "PYI", "PT", "Q", "RSE", "RET", "SLF", "SLOT", "SIM", "TID", "TCH", "INT", "PTH", @@ -28,9 +30,7 @@ unfixable = ["ERA"] # PD, NPY, AIR: ignored, panda / numpy / airflow specific # FURB: not yet out of preview - - -[tool.ruff.extend-per-file-ignores] +[tool.ruff.lint.extend-per-file-ignores] "config/*" = ["PGH004", # vague NOQA "FIX002"] # TODO: fix this" "*" = ["RET505"] # disagree with if X: return Y else: return Z being wrong @@ -43,7 +43,7 @@ unfixable = ["ERA"] "judgments/*" = ["FIX002"] # TODOs, should fix "conftest.py" = ["PT004"] # not even sure what this code is doing. -[tool.ruff.isort] +[tool.ruff.lint.isort] known-first-party = ["ds-caselaw-editor-ui", "config"] -[tool.ruff.pycodestyle] +[tool.ruff.lint.pycodestyle]