-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ensure optimize is run with liquid_clustered_by #463
Conversation
… tests at least validate that a zorder statement was issued
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with one suggestion.
tests/integration/base.py
Outdated
@@ -605,6 +605,12 @@ def _assertTablesEqualSql(self, relation_a, relation_b, columns=None): | |||
|
|||
return sql | |||
|
|||
def assert_in_log(self, message) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is eloquent. Will it make sense to use it elsewhere in the test suite retroactively?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only other place this behavior exists today checks for several different messages. For the most part you shouldn't look at the log, since you can just as easily look at stdout with run_and_capture; here I specifically need to look at debug messages, which I'm only doing because I don't know another good way to observe optimize. So short answer is, I may expand this in the future to take multiple messages, at which point that other test can fold in, but I also don't want to encourage log scanning lol.
def assert_in_log(self, message) -> None: | ||
log_file = os.path.join(self._logs_dir, "dbt.log") | ||
with open(log_file, "r") as f: | ||
log = f.read() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One recommendation, run either .upper()
or .lower()
on both the input and the log message in case of capitalisation differences.
Resolves #448
Description
Discovered that we weren't running optimize with liquid_cluster_by because the optimize clause was only set up to respect z-ordering.
Checklist
CHANGELOG.md
and added information about my change to the "dbt-databricks next" section.