Skip to content

Commit

Permalink
remove logbook (#10119)
Browse files Browse the repository at this point in the history
* remove logbook

* some cleanup, some bug fixes
  • Loading branch information
emmyoop authored May 13, 2024
1 parent 4443a91 commit 03b621f
Show file tree
Hide file tree
Showing 35 changed files with 124 additions and 2,230 deletions.
6 changes: 6 additions & 0 deletions .changes/unreleased/Dependencies-20240509-093717.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Dependencies
body: Remove logbook dependency
time: 2024-05-09T09:37:17.745129-05:00
custom:
Author: emmyoop
Issue: "8027"
2 changes: 0 additions & 2 deletions core/dbt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@

### links.py

### logger.py

### main.py

### node_types.py
Expand Down
2 changes: 1 addition & 1 deletion core/dbt/artifacts/schemas/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def inner(cls: Type[VersionedSchema]):
return inner


# This is used in the ArtifactMixin and RemoteResult classes
# This is used in the ArtifactMixin and RemoteCompileResultMixin classes
@dataclasses.dataclass
class VersionedSchema(dbtClassMixin):
dbt_schema_version: ClassVar[SchemaVersion]
Expand Down
1 change: 0 additions & 1 deletion core/dbt/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ def global_flags(func):
@p.deprecated_favor_state
@p.deprecated_print
@p.deprecated_state
@p.enable_legacy_logger
@p.fail_fast
@p.favor_state
@p.indirect_selection
Expand Down
6 changes: 0 additions & 6 deletions core/dbt/cli/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,6 @@
is_flag=True,
)

enable_legacy_logger = click.option(
"--enable-legacy-logger/--no-enable-legacy-logger",
envvar="DBT_ENABLE_LEGACY_LOGGER",
hidden=True,
)

exclude = click.option(
"--exclude",
envvar=None,
Expand Down
12 changes: 2 additions & 10 deletions core/dbt/contracts/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from dbt.artifacts.schemas.results import ExecutionResult, TimingInfo
from dbt.artifacts.schemas.run import RunExecutionResult, RunResult, RunResultsArtifact
from dbt.contracts.graph.nodes import ResultNode
from dbt.logger import LogMessage
from dbt_common.dataclass_schema import dbtClassMixin

TaskTags = Optional[Dict[str, Any]]
Expand All @@ -17,12 +16,7 @@


@dataclass
class RemoteResult(VersionedSchema):
logs: List[LogMessage]


@dataclass
class RemoteCompileResultMixin(RemoteResult):
class RemoteCompileResultMixin(VersionedSchema):
raw_code: str
compiled_code: str
node: ResultNode
Expand All @@ -41,7 +35,7 @@ def error(self):

@dataclass
@schema_version("remote-execution-result", 1)
class RemoteExecutionResult(ExecutionResult, RemoteResult):
class RemoteExecutionResult(ExecutionResult):
results: Sequence[RunResult]
args: Dict[str, Any] = field(default_factory=dict)
generated_at: datetime = field(default_factory=datetime.utcnow)
Expand All @@ -59,14 +53,12 @@ def write(self, path: str):
def from_local_result(
cls,
base: RunExecutionResult,
logs: List[LogMessage],
) -> "RemoteExecutionResult":
return cls(
generated_at=base.generated_at,
results=base.results,
elapsed_time=base.elapsed_time,
args=base.args,
logs=logs,
)


Expand Down
18 changes: 0 additions & 18 deletions core/dbt/flags.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,6 @@
# Do not import the os package because we expose this package in jinja
from argparse import Namespace
from os import getenv as os_getenv
from pathlib import Path
from typing import Optional


# for setting up logger for legacy logger
def env_set_truthy(key: str) -> Optional[str]:
"""Return the value if it was set to a "truthy" string value or None
otherwise.
"""
value = os_getenv(key)
if not value or value.lower() in ("0", "false", "f"):
return None
return value


# for setting up logger for legacy logger
ENABLE_LEGACY_LOGGER = env_set_truthy("DBT_ENABLE_LEGACY_LOGGER")


# this roughly follows the patten of EVENT_MANAGER in dbt/common/events/functions.py
# During de-globlization, we'll need to handle both similarly
Expand Down
Loading

0 comments on commit 03b621f

Please sign in to comment.