ferruzzi commented on code in PR #38756:
URL: https://github.com/apache/airflow/pull/38756#discussion_r1552490082
##########
pyproject.toml:
##########
@@ -339,14 +340,17 @@ combine-as-imports = true
"*/example_dags/*" = ["D"]
"chart/*" = ["D"]
"dev/*" = ["D"]
-# In addition, ignore top level imports, e.g. pandas, numpy (TID253) and use
of assert (S101) in tests
+# In addition, ignore in tests
+# TID253: Banned top level imports, e.g. pandas, numpy
+# S101: Use `assert`
+# TRY002: Use `raise Exception`
Review Comment:
Nice! That's a handy summary
##########
pyproject.toml:
##########
@@ -368,13 +372,53 @@ combine-as-imports = true
"tests/providers/google/cloud/operators/test_vertex_ai.py" = ["E402"]
"tests/providers/google/cloud/operators/vertex_ai/test_generative_model.py" =
["E402"]
"tests/providers/google/cloud/triggers/test_vertex_ai.py" = ["E402"]
-
"tests/providers/openai/hooks/test_openai.py" = ["E402"]
"tests/providers/openai/operators/test_openai.py" = ["E402"]
"tests/providers/qdrant/hooks/test_qdrant.py" = ["E402"]
"tests/providers/qdrant/operators/test_qdrant.py" = ["E402"]
"tests/providers/snowflake/operators/test_snowflake_sql.py" = ["E402"]
+# All the providers modules which do not follow TRY002 yet
Review Comment:
This is essentially a TODO list, right? Or have all possible fixes already
been made and these are the unfixable ones?
##########
pyproject.toml:
##########
@@ -288,6 +288,7 @@ extend-select = [
"B004", # Checks for use of hasattr(x, "__call__") and replaces it with
callable(x)
"B006", # Checks for uses of mutable objects as function argument defaults.
"B019", # Use of functools.lru_cache or functools.cache on methods can
lead to memory leaks
+ "TRY002", # Prohibit to use `raise Exception`, instead of that contributor
should use specific exception
Review Comment:
```suggestion
"TRY002", # Prohibit use of `raise Exception`, use specific exceptions
instead.
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]