Skip to content

Commit

Permalink
Simple rename of dbt generated models folder (#3469)
Browse files Browse the repository at this point in the history
* Rename folder where models are generated from airbyte_views to airbyte_ctes

* Integration test outputs are moved around as a result
  • Loading branch information
ChristopheDuong committed May 18, 2021
1 parent d4bcb18 commit 8790fc1
Show file tree
Hide file tree
Showing 185 changed files with 17 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,12 @@ quoting:
models:
airbyte_utils:
generated:
airbyte_views:
+tags: airbyte_views
# see https://docs.getdbt.com/docs/building-a-dbt-project/building-models/materializations/
# Faster but harder to debug
airbyte_ctes:
+tags: airbyte_internal_cte
+materialized: ephemeral
# May be slower on some destinations but generally recommended
# +materialized: view
airbyte_views:
+tags: airbyte_internal_views
+materialized: view
airbyte_tables:
+tags: normalized_tables
+materialized: table
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -373,9 +373,17 @@ def run_check_dbt_command(command: str, cwd: str) -> bool:
f.write(line)
str_line = line.decode("utf-8")
sys.stdout.write(str_line)
if ("ERROR" in str_line or "FAIL" in str_line or "WARNING" in str_line) and "Done." not in str_line and "PASS=" not in str_line:
# count lines mentionning ERROR (but ignore the one from dbt run summary)
error_count += 1
# keywords to match lines as signaling errors
if "ERROR" in str_line or "FAIL" in str_line or "WARNING" in str_line:
# exception keywords in lines to ignore as errors (such as summary or expected warnings)
if not (
"Done." in str_line # DBT Summary
or "PASS=" in str_line # DBT Summary
or "Nothing to do." in str_line # When no schema/data tests are setup
or "Configuration paths exist in your dbt_project.yml" # When catalog does not generate a view or cte
):
# count lines signaling an error/failure/warning
error_count += 1
process.wait()
print(f"{' '.join(commands)}\n\tterminated with return code {process.returncode} with {error_count} 'ERROR' mention(s).")
if error_count > 0:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ def add_to_outputs(self, sql: str, is_intermediate: bool, suffix: str = "") -> s
self.add_table_to_local_registry(file_name, table_name, is_intermediate)
file = f"{file_name}.sql"
if is_intermediate:
output = os.path.join("airbyte_views", self.schema, file)
output = os.path.join("airbyte_ctes", self.schema, file)
else:
output = os.path.join("airbyte_tables", self.schema, file)
tags = self.get_model_tags(is_intermediate)
Expand Down

0 comments on commit 8790fc1

Please sign in to comment.