diff --git a/core/dbt/clients/agate_helper.py b/core/dbt/clients/agate_helper.py index 06ccf5168f6..bd2dfca5fa4 100644 --- a/core/dbt/clients/agate_helper.py +++ b/core/dbt/clients/agate_helper.py @@ -17,7 +17,7 @@ class Number(agate.data_types.Number): # undo the change in https://github.com/wireservice/agate/pull/733 # i.e. do not cast True and False to numeric 1 and 0 def cast(self, d): - if type(d) == bool: + if type(d) == bool: # noqa: E721 raise agate.exceptions.CastError( 'Do not cast True to 1 or False to 0.' ) diff --git a/core/dbt/contracts/graph/manifest.py b/core/dbt/contracts/graph/manifest.py index fe5288f1a94..ce15237598e 100644 --- a/core/dbt/contracts/graph/manifest.py +++ b/core/dbt/contracts/graph/manifest.py @@ -480,7 +480,7 @@ def find_macro_by_name( """ filter: Optional[Callable[[MacroCandidate], bool]] = None if package is not None: - def filter(candidate: MacroCandidate) -> bool: + def filter(candidate: MacroCandidate) -> bool: # noqa: F811 return package == candidate.macro.package_name candidates: CandidateList = self._find_macros_by_name( diff --git a/core/dbt/events/functions.py b/core/dbt/events/functions.py index bb96add6f82..0f300aefa09 100644 --- a/core/dbt/events/functions.py +++ b/core/dbt/events/functions.py @@ -192,7 +192,7 @@ def create_info_text_log_line(e: T_Event, msg_fn: Callable[[T_Event], str]) -> s def create_debug_text_log_line(e: T_Event, msg_fn: Callable[[T_Event], str]) -> str: log_line: str = '' # Create a separator if this is the beginning of an invocation - if type(e) == MainReportVersion: + if type(e) == MainReportVersion: # noqa: E721 separator = 30 * '=' log_line = f'\n\n{separator} {e.get_ts()} | {get_invocation_id()} {separator}\n' color_tag: str = '' if this.format_color else Style.RESET_ALL @@ -212,7 +212,7 @@ def create_debug_text_log_line(e: T_Event, msg_fn: Callable[[T_Event], str]) -> # translates an Event to a completely formatted json log line # you have to specify which message you want. (i.e. - e.message(), e.cli_msg(), e.file_msg()) def create_json_log_line(e: T_Event, msg_fn: Callable[[T_Event], str]) -> Optional[str]: - if type(e) == EmptyLine: + if type(e) == EmptyLine: # noqa: E721 return None # will not be sent to logger # using preformatted string instead of formatting it here to be extra careful about timezone values = event_to_serializable_dict(e, lambda _: e.get_ts_rfc3339(), lambda x: msg_fn(x)) diff --git a/core/dbt/events/types.py b/core/dbt/events/types.py index f1b178ca28a..2e2b942c9e1 100644 --- a/core/dbt/events/types.py +++ b/core/dbt/events/types.py @@ -574,7 +574,7 @@ def message(self) -> str: def asdict(cls, data: list) -> dict: d = dict() for k, v in data: - if type(v) == list: + if type(v) == list: # noqa: E721 d[k] = [str(x) for x in v] return d diff --git a/core/dbt/parser/schemas.py b/core/dbt/parser/schemas.py index 7dd7663abbb..080d8ba544b 100644 --- a/core/dbt/parser/schemas.py +++ b/core/dbt/parser/schemas.py @@ -232,9 +232,9 @@ def create_test_node( def get_hashable_md( data: Union[str, int, float, List, Dict] ) -> Union[str, List, Dict]: - if type(data) == dict: + if type(data) == dict: # noqa: E721 return {k: get_hashable_md(data[k]) for k in sorted(data.keys())} # type: ignore - elif type(data) == list: + elif type(data) == list: # noqa: E721 return [get_hashable_md(val) for val in data] # type: ignore else: return str(data)