Skip to content
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

merge main to feature/click-cli #6483

Merged
merged 4 commits into from Jan 6, 2023
Merged

Conversation

ChenyuLInx
Copy link
Contributor

@ChenyuLInx ChenyuLInx commented Dec 23, 2022

resolves #6478

Merges all changes from main to feature branch for click

@ChenyuLInx ChenyuLInx requested a review from a team as a code owner December 23, 2022 00:24
@ChenyuLInx ChenyuLInx requested a review from a team December 23, 2022 00:24
@ChenyuLInx ChenyuLInx requested review from a team and leahwicz as code owners December 23, 2022 00:24
@cla-bot cla-bot bot added the cla:yes label Dec 23, 2022
@ChenyuLInx ChenyuLInx requested review from iknox-fa, peterallenwebb, MichelleArk and stu-k and removed request for a team, leahwicz and McKnight-42 December 23, 2022 00:26
def setup_event_logger(log_path, log_format, use_colors, debug):
global FILE_LOG
global STDOUT_LOG
def _get_stdout_config(log_format: str, debug: bool, use_colors: bool) -> LoggerConfig:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@peterallenwebb I feel like I got to a sub optimal solution for this entire file to make mypy happy. Feel free to update or point me to the right direction

@@ -708,7 +704,7 @@ def build_manifest_state_check(self):
vars_hash = FileHash.from_contents(
"\x00".join(
[
getattr(config.args, "vars", "{}") or "{}",
str(getattr(config.args, "vars", "{}") or "{}"),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is being modified to support new loaded args

"deps",
self.project.hashed_name(),
self.config,
self.config.args,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Updated!

# currently fire before logs can be configured by setup_event_logger(), we
# create a default configuration with default settings and no file output.
EVENT_MANAGER: EventManager = EventManager()
EVENT_MANAGER.add_logger(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this seems right?

# Create second stdout logger to support test which want to know what's
# being sent to stdout.
# debug here is true because we need to capture debug events, and we pass in false in main
capture_config = _get_stdout_config(log_format, True, use_colors)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This hard coded DEBUG is for tests, is it okay?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to me that we could pass the value of debug here as well, rather than hard coding. And if the tests want the debug output they should execute dbt with the debug flag set to true. Does that seem wrong?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a issue regarding we add a stdout logger above this that also uses the debug flag, if debug is being set to true then that logger will actually raise some error during running tests.

@@ -211,7 +211,8 @@ def run_from_args(parsed):
if task.config is not None:
log_path = getattr(task.config, "log_path", None)
log_manager.set_path(log_path)
setup_event_logger(log_path or "logs", "json", False, True)
# WHY WE SET DEBUG TO BE TRUE HERE previously?
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing one hard-code to another to make sure all tests passing. This file should be removed after feature branch merged

Copy link
Contributor

@iknox-fa iknox-fa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, although I admit to not reading all 30,000+ lines :)

Copy link
Contributor

@MichelleArk MichelleArk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewing by opening a branch on top of this one with some minor tweaks to get integration tests passing: #6531. All tests are passing there with understandable changes (except for one adapter one, but that is fixed by changes on this branch), which makes me much more comfortable that we aren't introducing regressions to any new functionality from main in this merge.

Thank you so much for doing this merge @ChenyuLInx, it'll go a long way in reducing the cognitive overhead necessary for working on this feature branch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants