diff --git a/server/poetry.lock b/server/poetry.lock index eef712c7d..80e463e1c 100644 --- a/server/poetry.lock +++ b/server/poetry.lock @@ -3050,29 +3050,29 @@ pyasn1 = ">=0.1.3" [[package]] name = "ruff" -version = "0.8.6" +version = "0.9.1" description = "An extremely fast Python linter and code formatter, written in Rust." optional = false python-versions = ">=3.7" files = [ - {file = "ruff-0.8.6-py3-none-linux_armv6l.whl", hash = "sha256:defed167955d42c68b407e8f2e6f56ba52520e790aba4ca707a9c88619e580e3"}, - {file = "ruff-0.8.6-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:54799ca3d67ae5e0b7a7ac234baa657a9c1784b48ec954a094da7c206e0365b1"}, - {file = "ruff-0.8.6-py3-none-macosx_11_0_arm64.whl", hash = "sha256:e88b8f6d901477c41559ba540beeb5a671e14cd29ebd5683903572f4b40a9807"}, - {file = "ruff-0.8.6-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0509e8da430228236a18a677fcdb0c1f102dd26d5520f71f79b094963322ed25"}, - {file = "ruff-0.8.6-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:91a7ddb221779871cf226100e677b5ea38c2d54e9e2c8ed847450ebbdf99b32d"}, - {file = "ruff-0.8.6-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:248b1fb3f739d01d528cc50b35ee9c4812aa58cc5935998e776bf8ed5b251e75"}, - {file = "ruff-0.8.6-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:bc3c083c50390cf69e7e1b5a5a7303898966be973664ec0c4a4acea82c1d4315"}, - {file = "ruff-0.8.6-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:52d587092ab8df308635762386f45f4638badb0866355b2b86760f6d3c076188"}, - {file = "ruff-0.8.6-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:61323159cf21bc3897674e5adb27cd9e7700bab6b84de40d7be28c3d46dc67cf"}, - {file = "ruff-0.8.6-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7ae4478b1471fc0c44ed52a6fb787e641a2ac58b1c1f91763bafbc2faddc5117"}, - {file = "ruff-0.8.6-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:0c000a471d519b3e6cfc9c6680025d923b4ca140ce3e4612d1a2ef58e11f11fe"}, - {file = "ruff-0.8.6-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:9257aa841e9e8d9b727423086f0fa9a86b6b420fbf4bf9e1465d1250ce8e4d8d"}, - {file = "ruff-0.8.6-py3-none-musllinux_1_2_i686.whl", hash = "sha256:45a56f61b24682f6f6709636949ae8cc82ae229d8d773b4c76c09ec83964a95a"}, - {file = "ruff-0.8.6-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:496dd38a53aa173481a7d8866bcd6451bd934d06976a2505028a50583e001b76"}, - {file = "ruff-0.8.6-py3-none-win32.whl", hash = "sha256:e169ea1b9eae61c99b257dc83b9ee6c76f89042752cb2d83486a7d6e48e8f764"}, - {file = "ruff-0.8.6-py3-none-win_amd64.whl", hash = "sha256:f1d70bef3d16fdc897ee290d7d20da3cbe4e26349f62e8a0274e7a3f4ce7a905"}, - {file = "ruff-0.8.6-py3-none-win_arm64.whl", hash = "sha256:7d7fc2377a04b6e04ffe588caad613d0c460eb2ecba4c0ccbbfe2bc973cbc162"}, - {file = "ruff-0.8.6.tar.gz", hash = "sha256:dcad24b81b62650b0eb8814f576fc65cfee8674772a6e24c9b747911801eeaa5"}, + {file = "ruff-0.9.1-py3-none-linux_armv6l.whl", hash = "sha256:84330dda7abcc270e6055551aca93fdde1b0685fc4fd358f26410f9349cf1743"}, + {file = "ruff-0.9.1-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:3cae39ba5d137054b0e5b472aee3b78a7c884e61591b100aeb544bcd1fc38d4f"}, + {file = "ruff-0.9.1-py3-none-macosx_11_0_arm64.whl", hash = "sha256:50c647ff96f4ba288db0ad87048257753733763b409b2faf2ea78b45c8bb7fcb"}, + {file = "ruff-0.9.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f0c8b149e9c7353cace7d698e1656ffcf1e36e50f8ea3b5d5f7f87ff9986a7ca"}, + {file = "ruff-0.9.1-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:beb3298604540c884d8b282fe7625651378e1986c25df51dec5b2f60cafc31ce"}, + {file = "ruff-0.9.1-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:39d0174ccc45c439093971cc06ed3ac4dc545f5e8bdacf9f067adf879544d969"}, + {file = "ruff-0.9.1-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:69572926c0f0c9912288915214ca9b2809525ea263603370b9e00bed2ba56dbd"}, + {file = "ruff-0.9.1-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:937267afce0c9170d6d29f01fcd1f4378172dec6760a9f4dface48cdabf9610a"}, + {file = "ruff-0.9.1-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:186c2313de946f2c22bdf5954b8dd083e124bcfb685732cfb0beae0c47233d9b"}, + {file = "ruff-0.9.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3f94942a3bb767675d9a051867c036655fe9f6c8a491539156a6f7e6b5f31831"}, + {file = "ruff-0.9.1-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:728d791b769cc28c05f12c280f99e8896932e9833fef1dd8756a6af2261fd1ab"}, + {file = "ruff-0.9.1-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:2f312c86fb40c5c02b44a29a750ee3b21002bd813b5233facdaf63a51d9a85e1"}, + {file = "ruff-0.9.1-py3-none-musllinux_1_2_i686.whl", hash = "sha256:ae017c3a29bee341ba584f3823f805abbe5fe9cd97f87ed07ecbf533c4c88366"}, + {file = "ruff-0.9.1-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:5dc40a378a0e21b4cfe2b8a0f1812a6572fc7b230ef12cd9fac9161aa91d807f"}, + {file = "ruff-0.9.1-py3-none-win32.whl", hash = "sha256:46ebf5cc106cf7e7378ca3c28ce4293b61b449cd121b98699be727d40b79ba72"}, + {file = "ruff-0.9.1-py3-none-win_amd64.whl", hash = "sha256:342a824b46ddbcdddd3abfbb332fa7fcaac5488bf18073e841236aadf4ad5c19"}, + {file = "ruff-0.9.1-py3-none-win_arm64.whl", hash = "sha256:1cd76c7f9c679e6e8f2af8f778367dca82b95009bc7b1a85a47f1521ae524fa7"}, + {file = "ruff-0.9.1.tar.gz", hash = "sha256:fd2b25ecaf907d6458fa842675382c8597b3c746a2dde6717fe3415425df0c17"}, ] [[package]] @@ -3682,4 +3682,4 @@ pypika = ["PyPika"] [metadata] lock-version = "2.0" python-versions = ">=3.11, <3.13" -content-hash = "8959e4d9688a642b3b826467cdbfd9123fdf635d46ee81d7d86a761d86bcf15e" +content-hash = "2de8d793a0a166c63ab738b88d1d56590e35ecd831d695f7e5e07924db1da1ac" diff --git a/server/pyproject.toml b/server/pyproject.toml index a20a5c768..460d08a42 100644 --- a/server/pyproject.toml +++ b/server/pyproject.toml @@ -75,7 +75,7 @@ psycopg2 = "^2.9.7" pymongo = ">=4.2.0" PyYAML = "^6.0" redshift-connector = "^2.1.3" -ruff = ">=0.5.0,<0.9" +ruff = ">=0.5.0,<0.10" pre-commit = ">=3.4,<5.0" tenacity = ">=8.4.2,<10.0.0" diff --git a/server/src/weaverbird/backends/mongo_translator/steps/percentage.py b/server/src/weaverbird/backends/mongo_translator/steps/percentage.py index 63dccd1cd..970671f16 100644 --- a/server/src/weaverbird/backends/mongo_translator/steps/percentage.py +++ b/server/src/weaverbird/backends/mongo_translator/steps/percentage.py @@ -8,7 +8,7 @@ def translate_percentage(step: PercentageStep) -> list[MongoStep]: "$group": { "_id": {g: f"${g}" for g in step.group} if step.group else None, "_vqbAppArray": {"$push": "$$ROOT"}, - "_vqbTotalDenum": {"$sum": f"${step.column }"}, + "_vqbTotalDenum": {"$sum": f"${step.column}"}, }, }, {"$unwind": "$_vqbAppArray"}, diff --git a/server/src/weaverbird/backends/mongo_translator/steps/todate.py b/server/src/weaverbird/backends/mongo_translator/steps/todate.py index 3bad4d82a..106f8cfd0 100644 --- a/server/src/weaverbird/backends/mongo_translator/steps/todate.py +++ b/server/src/weaverbird/backends/mongo_translator/steps/todate.py @@ -179,7 +179,7 @@ def translate_todate(step: ToDateStep) -> list[MongoStep]: MONTH_REPLACEMENT_STEP: MongoStep = { "$addFields": { - "_vqbTempMonth" "$switch": { + "_vqbTempMonth$switch": { "branches": [ { "case": {"$in": month_names}, diff --git a/server/src/weaverbird/backends/pypika_translator/translators/base.py b/server/src/weaverbird/backends/pypika_translator/translators/base.py index cb42d269d..ab6588912 100644 --- a/server/src/weaverbird/backends/pypika_translator/translators/base.py +++ b/server/src/weaverbird/backends/pypika_translator/translators/base.py @@ -348,9 +348,9 @@ def get_query_builder( ) -> QueryBuilderContext: if len(steps) <= 0: raise ValueError("No steps provided") - assert ( - steps[0].name == "domain" or steps[0].name == "customsql" - ), f"First step must be one of domain or customsql step, got '{steps[0].name}'" + assert steps[0].name == "domain" or steps[0].name == "customsql", ( + f"First step must be one of domain or customsql step, got '{steps[0].name}'" + ) self._step_count = 0 # A single custom SQL step must always be wrapped in a CTE, as we cannot apply offset and diff --git a/server/tests/backends/mongo_translator/steps/test_evolution.py b/server/tests/backends/mongo_translator/steps/test_evolution.py index 55c88eb35..147204673 100644 --- a/server/tests/backends/mongo_translator/steps/test_evolution.py +++ b/server/tests/backends/mongo_translator/steps/test_evolution.py @@ -65,7 +65,7 @@ def test_translate_evolution() -> None: "bar_EVOL_ABS": { "$cond": [ {"$eq": ["$_VQB_VALUE_PREV", "Error"]}, - "Error: More than one previous " "date found for the specified " "index columns", + "Error: More than one previous date found for the specified index columns", {"$subtract": ["$bar", "$_VQB_VALUE_PREV"]}, ] } diff --git a/server/tests/backends/sql_translator_integration_tests/test_sql_mysql_translator_steps.py b/server/tests/backends/sql_translator_integration_tests/test_sql_mysql_translator_steps.py index 0dc66ef32..391fc4b37 100644 --- a/server/tests/backends/sql_translator_integration_tests/test_sql_mysql_translator_steps.py +++ b/server/tests/backends/sql_translator_integration_tests/test_sql_mysql_translator_steps.py @@ -29,7 +29,7 @@ "port": 3306, "database": "mysql_db", } -_CONNECTION_STRING = f'mysql+pymysql://{_CON_PARAMS["user"]}:{_CON_PARAMS["password"]}@{_CON_PARAMS["host"]}:{_CON_PARAMS["port"]}/{_CON_PARAMS["database"]}' +_CONNECTION_STRING = f"mysql+pymysql://{_CON_PARAMS['user']}:{_CON_PARAMS['password']}@{_CON_PARAMS['host']}:{_CON_PARAMS['port']}/{_CON_PARAMS['database']}" @pytest.fixture(scope="module") diff --git a/server/tests/backends/sql_translator_integration_tests/test_sql_postgres_translator_steps.py b/server/tests/backends/sql_translator_integration_tests/test_sql_postgres_translator_steps.py index e5d660c21..7672c45a4 100644 --- a/server/tests/backends/sql_translator_integration_tests/test_sql_postgres_translator_steps.py +++ b/server/tests/backends/sql_translator_integration_tests/test_sql_postgres_translator_steps.py @@ -29,7 +29,7 @@ "port": 5432, "database": "pg_db", } -connection_string = f'postgresql://{con_params["user"]}:{con_params["password"]}@{con_params["host"]}:{con_params["port"]}/{con_params["database"]}' +connection_string = f"postgresql://{con_params['user']}:{con_params['password']}@{con_params['host']}:{con_params['port']}/{con_params['database']}" @pytest.fixture(scope="module") diff --git a/server/tests/steps/test_top.py b/server/tests/steps/test_top.py index ce9d4a038..72882eaea 100644 --- a/server/tests/steps/test_top.py +++ b/server/tests/steps/test_top.py @@ -13,7 +13,7 @@ def sample_df(): return DataFrame( { - "Label": [f"Label {i+1}" for i in range(6)], + "Label": [f"Label {i + 1}" for i in range(6)], "Group": ["Group 1"] * 3 + ["Group 2"] * 3, "Value": [13, 7, 20, 1, 10, 5], }