diff --git a/core/dbt/dataclass_schema.py b/core/dbt/dataclass_schema.py index da95699eda6..309d72975b6 100644 --- a/core/dbt/dataclass_schema.py +++ b/core/dbt/dataclass_schema.py @@ -22,7 +22,7 @@ def serialize(self, value): out = value.isoformat() # Assume UTC if timezone is missing if value.tzinfo is None: - out = out + "Z" + out += "Z" return out def deserialize(self, value): diff --git a/core/dbt/graph/selector_spec.py b/core/dbt/graph/selector_spec.py index 2e7d37dbb1b..7940abf8418 100644 --- a/core/dbt/graph/selector_spec.py +++ b/core/dbt/graph/selector_spec.py @@ -149,7 +149,7 @@ def dict_from_single_spec(cls, raw: str): method_name, method_arguments = cls.parse_method(dct) meth_name = str(method_name) if method_arguments: - meth_name = meth_name + '.' + '.'.join(method_arguments) + meth_name += '.' + '.'.join(method_arguments) dct['method'] = meth_name dct = {k: v for k, v in dct.items() if (v is not None and v != '')} if 'childrens_parents' in dct: diff --git a/core/dbt/parser/manifest.py b/core/dbt/parser/manifest.py index e1a63964611..b37d9685d2b 100644 --- a/core/dbt/parser/manifest.py +++ b/core/dbt/parser/manifest.py @@ -398,7 +398,7 @@ def load_and_parse_macros(self, project_parser_files): block = FileBlock(self.manifest.files[file_id]) parser.parse_file(block) # increment parsed path count for performance tracking - self._perf_info.parsed_path_count = self._perf_info.parsed_path_count + 1 + self._perf_info.parsed_path_count += 1 # generic tests hisotrically lived in the macros directoy but can now be nested # in a /generic directory under /tests so we want to process them here as well if 'GenericTestParser' in parser_files: @@ -407,7 +407,7 @@ def load_and_parse_macros(self, project_parser_files): block = FileBlock(self.manifest.files[file_id]) parser.parse_file(block) # increment parsed path count for performance tracking - self._perf_info.parsed_path_count = self._perf_info.parsed_path_count + 1 + self._perf_info.parsed_path_count += 1 self.build_macro_resolver() # Look at changed macros and update the macro.depends_on.macros @@ -450,7 +450,7 @@ def parse_project( parser.parse_file(block, dct=dct) else: parser.parse_file(block) - project_parsed_path_count = project_parsed_path_count + 1 + project_parsed_path_count += 1 # Save timing info project_loader_info.parsers.append(ParserInfo( @@ -458,7 +458,7 @@ def parse_project( parsed_path_count=project_parsed_path_count, elapsed=time.perf_counter() - parser_start_timer )) - total_parsed_path_count = total_parsed_path_count + project_parsed_path_count + total_parsed_path_count += project_parsed_path_count # HookParser doesn't run from loaded files, just dbt_project.yml, # so do separately @@ -478,7 +478,7 @@ def parse_project( project_loader_info.parsed_path_count = ( project_loader_info.parsed_path_count + total_parsed_path_count ) - project_loader_info.elapsed = project_loader_info.elapsed + elapsed + project_loader_info.elapsed += elapsed self._perf_info.parsed_path_count = ( self._perf_info.parsed_path_count + total_parsed_path_count ) @@ -690,7 +690,7 @@ def build_manifest_state_check(self): key_list.sort() env_var_str = '' for key in key_list: - env_var_str = env_var_str + f'{key}:{config.project_env_vars[key]}|' + env_var_str += f'{key}:{config.project_env_vars[key]}|' project_env_vars_hash = FileHash.from_contents(env_var_str) # Create a FileHash of the env_vars in the project @@ -698,7 +698,7 @@ def build_manifest_state_check(self): key_list.sort() env_var_str = '' for key in key_list: - env_var_str = env_var_str + f'{key}:{config.profile_env_vars[key]}|' + env_var_str += f'{key}:{config.profile_env_vars[key]}|' profile_env_vars_hash = FileHash.from_contents(env_var_str) # Create a FileHash of the profile file diff --git a/test/integration/047_dbt_ls_test/test_ls.py b/test/integration/047_dbt_ls_test/test_ls.py index 9ab815c70c1..db66406f98b 100644 --- a/test/integration/047_dbt_ls_test/test_ls.py +++ b/test/integration/047_dbt_ls_test/test_ls.py @@ -42,7 +42,7 @@ def run_dbt_ls(self, args=None, expect_pass=True): log_manager.stdout_console() full_args = ['ls'] if args is not None: - full_args = full_args + args + full_args += args result = self.run_dbt(args=full_args, expect_pass=expect_pass) @@ -484,13 +484,13 @@ def expect_select(self): self.assertEqual(set(results), {'test.incremental'}) self.run_dbt_ls(['--select', 'config.incremental_strategy:insert_overwrite'], expect_pass=True) - + def expect_selected_keys(self): """Expect selected fields of the the selected model """ expectations = [{ - 'database': self.default_database, - 'schema': self.unique_schema(), + 'database': self.default_database, + 'schema': self.unique_schema(), 'alias': 'inner' }] results = self.run_dbt_ls(['--model', 'inner', '--output', 'json', '--output-keys', 'database,schema,alias']) @@ -498,7 +498,7 @@ def expect_selected_keys(self): for got, expected in zip(results, expectations): self.assertEqualJSON(got, expected) - + """Expect selected fields of the test resource types """ expectations = [ @@ -510,7 +510,7 @@ def expect_selected_keys(self): self.assertEqual(len(results), len(expectations)) for got, expected in zip( - sorted(results, key=lambda x: json.loads(x).get("name")), + sorted(results, key=lambda x: json.loads(x).get("name")), sorted(expectations, key=lambda x: x.get("name")) ): self.assertEqualJSON(got, expected) diff --git a/test/unit/test_macro_calls.py b/test/unit/test_macro_calls.py index 4c2837be257..e5ffc4bd736 100644 --- a/test/unit/test_macro_calls.py +++ b/test/unit/test_macro_calls.py @@ -17,16 +17,16 @@ def setUp(self): "{% macro lr_macro() %} {{ return(load_result('relations').table) }} {% endmacro %}", "{% macro get_snapshot_unique_id() -%} {{ return(adapter.dispatch('get_snapshot_unique_id')()) }} {%- endmacro %}", "{% macro get_columns_in_query(select_sql) -%} {{ return(adapter.dispatch('get_columns_in_query')(select_sql)) }} {% endmacro %}", - """{% macro test_mutually_exclusive_ranges(model) %} - with base as ( + """{% macro test_mutually_exclusive_ranges(model) %} + with base as ( select {{ get_snapshot_unique_id() }} as dbt_unique_id, - * + * from {{ model }} ) {% endmacro %}""", "{% macro test_my_test(model) %} select {{ dbt_utils.current_timestamp() }} {% endmacro %}", "{% macro some_test(model) -%} {{ return(adapter.dispatch('test_some_kind4', 'foo_utils4')) }} {%- endmacro %}", "{% macro some_test(model) -%} {{ return(adapter.dispatch('test_some_kind5', macro_namespace = 'foo_utils5')) }} {%- endmacro %}", - ] + ] self.possible_macro_calls = [ ['nested_macro'], @@ -47,6 +47,6 @@ def test_macro_calls(self): for macro_string in self.macro_strings: possible_macro_calls = statically_extract_macro_calls(macro_string, ctx) self.assertEqual(self.possible_macro_calls[index], possible_macro_calls) - index = index + 1 + index += 1