Skip to content

Conversation

@hmgaudecker
Copy link
Member

Basically make the linting stricter, mostly by moving exceptions to apply to tests only.

One open question would be the FBT (Boolean-typed positional arguments) rules. I would not mind converting them into keyword-only (all relatively recent additions), but in case you are worried that it may break user code, we can leave it as is.

FBT002 Boolean default positional argument in function definition
  --> src/dags/annotations.py:45:5
   |
43 | def get_annotations(
44 |     func: Callable[..., Any],
45 |     eval_str: Literal[False] = False,
   |     ^^^^^^^^
46 |     default: str | None = None,
47 | ) -> dict[str, str]: ...
   |

FBT002 Boolean default positional argument in function definition
  --> src/dags/annotations.py:53:5
   |
51 | def get_annotations(
52 |     func: Callable[..., Any],
53 |     eval_str: Literal[True] = True,
   |     ^^^^^^^^
54 |     default: type | None = None,
55 | ) -> dict[str, type]: ...
   |

FBT001 Boolean-typed positional argument in function definition
  --> src/dags/annotations.py:60:5
   |
58 | def get_annotations(
59 |     func: Callable[..., Any],
60 |     eval_str: bool = False,
   |     ^^^^^^^^
61 |     default: str | type | None = None,
62 | ) -> dict[str, str] | dict[str, type]:
   |

FBT002 Boolean default positional argument in function definition
  --> src/dags/annotations.py:60:5
   |
58 | def get_annotations(
59 |     func: Callable[..., Any],
60 |     eval_str: bool = False,
   |     ^^^^^^^^
61 |     default: str | type | None = None,
62 | ) -> dict[str, str] | dict[str, type]:
   |

FBT001 Boolean-typed positional argument in function definition
   --> src/dags/annotations.py:193:31
    |
192 | def _get_annotations_from_signature(
193 |     func: Callable[..., Any], eval_str: bool
    |                               ^^^^^^^^
194 | ) -> dict[str, Any]:
195 |     """Extract annotations from the function signature.
    |

FBT001 Boolean-typed positional argument in function definition
   --> src/dags/dag.py:232:5
    |
230 |     aggregator: Callable[[T, T], T] | None = None,
231 |     aggregator_return_type: str | None = None,
232 |     enforce_signature: bool = True,
    |     ^^^^^^^^^^^^^^^^^
233 |     set_annotations: bool = False,
234 |     lexsort_key: Callable[[str], Any] | None = None,
    |

FBT002 Boolean default positional argument in function definition
   --> src/dags/dag.py:232:5
    |
230 |     aggregator: Callable[[T, T], T] | None = None,
231 |     aggregator_return_type: str | None = None,
232 |     enforce_signature: bool = True,
    |     ^^^^^^^^^^^^^^^^^
233 |     set_annotations: bool = False,
234 |     lexsort_key: Callable[[str], Any] | None = None,
    |

FBT001 Boolean-typed positional argument in function definition
   --> src/dags/dag.py:233:5
    |
231 |     aggregator_return_type: str | None = None,
232 |     enforce_signature: bool = True,
233 |     set_annotations: bool = False,
    |     ^^^^^^^^^^^^^^^
234 |     lexsort_key: Callable[[str], Any] | None = None,
235 | ) -> Callable[..., Any]:
    |

FBT002 Boolean default positional argument in function definition
   --> src/dags/dag.py:233:5
    |
231 |     aggregator_return_type: str | None = None,
232 |     enforce_signature: bool = True,
233 |     set_annotations: bool = False,
    |     ^^^^^^^^^^^^^^^
234 |     lexsort_key: Callable[[str], Any] | None = None,
235 | ) -> Callable[..., Any]:
    |

FBT001 Boolean-typed positional argument in function definition
   --> src/dags/dag.py:361:5
    |
359 |     functions: dict[str, Callable[..., Any]] | list[Callable[..., Any]],
360 |     targets: str | list[str] | None,
361 |     include_targets: bool = False,
    |     ^^^^^^^^^^^^^^^
362 | ) -> set[str]:
363 |     """Build a DAG and extract all ancestors of targets.
    |

FBT002 Boolean default positional argument in function definition
   --> src/dags/dag.py:361:5
    |
359 |     functions: dict[str, Callable[..., Any]] | list[Callable[..., Any]],
360 |     targets: str | list[str] | None,
361 |     include_targets: bool = False,
    |     ^^^^^^^^^^^^^^^
362 | ) -> set[str]:
363 |     """Build a DAG and extract all ancestors of targets.
    |

FBT001 Boolean-typed positional argument in function definition
   --> src/dags/dag.py:546:5
    |
544 |     functions: dict[str, Callable[..., Any]],
545 |     dag: nx.DiGraph[str],
546 |     verify_annotations: bool = False,
    |     ^^^^^^^^^^^^^^^^^^
547 |     lexsort_key: Callable[[str], Any] | None = None,
548 | ) -> dict[str, FunctionExecutionInfo]:
    |

FBT002 Boolean default positional argument in function definition
   --> src/dags/dag.py:546:5
    |
544 |     functions: dict[str, Callable[..., Any]],
545 |     dag: nx.DiGraph[str],
546 |     verify_annotations: bool = False,
    |     ^^^^^^^^^^^^^^^^^^
547 |     lexsort_key: Callable[[str], Any] | None = None,
548 | ) -> dict[str, FunctionExecutionInfo]:
    |

FBT001 Boolean-typed positional argument in function definition
   --> src/dags/dag.py:585:5
    |
583 |     arglist: list[str],
584 |     targets: list[str],
585 |     enforce_signature: bool,
    |     ^^^^^^^^^^^^^^^^^
586 |     set_annotations: bool,
587 | ) -> Callable[..., tuple[Any, ...]]:
    |

FBT001 Boolean-typed positional argument in function definition
   --> src/dags/dag.py:586:5
    |
584 |     targets: list[str],
585 |     enforce_signature: bool,
586 |     set_annotations: bool,
    |     ^^^^^^^^^^^^^^^
587 | ) -> Callable[..., tuple[Any, ...]]:
588 |     """Create a concatenated function object with correct signature.
    |

FBT001 Boolean-typed positional argument in function definition
  --> src/dags/output.py:40:5
   |
38 | def single_output(
39 |     func: Callable[P, tuple[T, *Unpack[MixedTupleType]]] | Callable[P, tuple[T, ...]],
40 |     set_annotations: bool = False,
   |     ^^^^^^^^^^^^^^^
41 | ) -> Callable[P, T]:
42 |     """Convert tuple output to single output; i.e. the first element of the tuple."""
   |

FBT002 Boolean default positional argument in function definition
  --> src/dags/output.py:40:5
   |
38 | def single_output(
39 |     func: Callable[P, tuple[T, *Unpack[MixedTupleType]]] | Callable[P, tuple[T, ...]],
40 |     set_annotations: bool = False,
   |     ^^^^^^^^^^^^^^^
41 | ) -> Callable[P, T]:
42 |     """Convert tuple output to single output; i.e. the first element of the tuple."""
   |

FBT001 Boolean-typed positional argument in function definition
   --> src/dags/tree/dag_tree.py:130:5
    |
128 |     inputs: NestedInputDict,
129 |     targets: NestedTargetDict | None,
130 |     enforce_signature: bool = True,
    |     ^^^^^^^^^^^^^^^^^
131 | ) -> Callable[[NestedInputDict], NestedOutputDict]:
132 |     """Combine a nested dictionary of functions into a single callable.
    |

FBT002 Boolean default positional argument in function definition
   --> src/dags/tree/dag_tree.py:130:5
    |
128 |     inputs: NestedInputDict,
129 |     targets: NestedTargetDict | None,
130 |     enforce_signature: bool = True,
    |     ^^^^^^^^^^^^^^^^^
131 | ) -> Callable[[NestedInputDict], NestedOutputDict]:
132 |     """Combine a nested dictionary of functions into a single callable.

@hmgaudecker hmgaudecker requested review from janosg and timmens January 17, 2026 07:00
@codecov
Copy link

codecov bot commented Jan 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.57%. Comparing base (f56a4a8) to head (5893b76).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #66   +/-   ##
=======================================
  Coverage   95.57%   95.57%           
=======================================
  Files          23       23           
  Lines        1174     1174           
=======================================
  Hits         1122     1122           
  Misses         52       52           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants