Skip to content

Conversation

@asnare
Copy link
Contributor

@asnare asnare commented Nov 27, 2025

Changes

This PR updates log-level handoff to the labs tools: they expect disabled instead of the default (WARN) if the user didn't explicitly specify a log-level.

Why

For various historical reasons, the labs tools were written with a default of INFO in mind and use this if the user doesn't explicitly provide a log-level when running a command. Prior to #2213 we used to receive disabled and it all worked as intended because the tools checked for this and could default to INFO themselves when it was detected.

However since #2213 the tools receive warn if the user didn't specify anything, and the tools can't distinguish between explicit --log-level=WARN and the default situation. This has lead to confusion amongst our users (and the FE teams involved) because suddenly the tool output changed.

With this change we're effectively reverting to the pre-#2213 behaviour which allows the labs tools to default to INFO while still respecting --debug, --log-level and DATABRICKS_LOG_LEVEL.

Tests

Table-driven tests check various scenarios, and also verify that there's no drift between the value we handoff and the log-level in use by the CLI. These changes have also been tested manually.

Caveats

One thing that's worth considering: it feels brittle that we have to mirror the logic from root/logger.go. The changes here are deliberately limited to just the labs area of the code, but if that constraint is relaxed there's probably a better way of handling it although it would mean changes outside the labs tree.

…cified by user.

Specifically, the handoff shouldn't use the default (WARN) if the user didn't specify it explicitly.
This is what the Python tools all expect when no logging level has been provided.
@asnare asnare requested review from alexott and nfx as code owners November 27, 2025 14:06
@asnare asnare changed the title Fix/labs default log level Fix/update default log-level handoff for databricks labs tools Nov 27, 2025
@github-actions
Copy link

An authorized user can trigger integration tests manually by following the instructions below:

Trigger:
go/deco-tests-run/cli

Inputs:

  • PR number: 4019
  • Commit SHA: 10af613279bdf7dd532253daf2c99f492087f515

Checks will be approved automatically on success.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant