Skip to content
This repository was archived by the owner on Apr 8, 2024. It is now read-only.

Commit 9463fad

Browse files
author
salim_moulouel
committed
support dbt-core between 1.7.0 to 1.7.8
1 parent cbdfc5d commit 9463fad

File tree

9 files changed

+21
-11
lines changed

9 files changed

+21
-11
lines changed

.github/workflows/test_cli.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- "3.10"
2222
# - "3.11"
2323
dbt:
24-
- "1.5.*"
24+
- "1.7.*"
2525

2626
# Run only the latest commit pushed to PR
2727
concurrency:

.github/workflows/test_integration_adapter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
# - duckdb
3434
# - sqlserver
3535
dbt_version:
36-
- "1.5.0"
36+
- "1.7.0"
3737
python:
3838
- "3.8"
3939
- "3.9"

.github/workflows/test_integration_cli.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ on:
5252
options:
5353
- "<ALL>"
5454
- "latest"
55-
- "1.5.*"
55+
- "1.7.*"
5656

5757
jobs:
5858
matrix-adapter:
@@ -163,7 +163,7 @@ jobs:
163163
shell: python
164164
run: |
165165
OPTIONS = [
166-
"1.5.*",
166+
"1.7.*",
167167
]
168168
OUTPUT = OPTIONS
169169

projects/adapter/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "dbt-fal"
3-
version = "1.5.10a0"
3+
version = "1.7.10a0"
44
# name = "fal"
55
# version = "0.9.4a0"
66
description = "Run python scripts from any dbt project."
@@ -22,7 +22,7 @@ classifiers = [
2222

2323
[tool.poetry.dependencies]
2424
python = "^3.8"
25-
dbt-core = ">=1.5,<=1.5.5"
25+
dbt-core = ">=1.7,<=1.7.8"
2626
pandas = "^1.3.4"
2727
posthog = "^1.4.5"
2828
"backports.functools_lru_cache" = "^1.6.4"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version = '1.5.10a0'
1+
version = '1.7.10a0'
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version = '1.5.10a0'
1+
version = '1.7.10a0'

projects/adapter/src/fal/dbt/cli/fal_runner.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,11 @@ def create_fal_dbt(
1414
args: argparse.Namespace, generated_models: Dict[str, Path] = {}
1515
) -> FalDbt:
1616
real_state = None
17+
real_defer_state = None
1718
if hasattr(args, "state") and args.state is not None:
1819
real_state = args.state
20+
if hasattr(args, "real_defer_state") and args.defer_state is not None:
21+
real_defer_state = args.state
1922

2023
return FalDbt(
2124
args.project_dir,
@@ -25,6 +28,7 @@ def create_fal_dbt(
2528
args.selector,
2629
args.threads,
2730
real_state,
31+
real_defer_state,
2832
args.target,
2933
args.vars,
3034
generated_models,

projects/adapter/src/fal/dbt/integration/parse.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from typing import Any, List, Dict, Optional, Union, TYPE_CHECKING
66

77
from dbt.contracts.project import Project as ProjectContract
8-
from dbt.config import RuntimeConfig, Project
8+
from dbt.config import RuntimeConfig, Project, PartialProject
99
from dbt.config.utils import parse_cli_vars as dbt_parse_cli_vars
1010
from dbt.contracts.graph.manifest import Manifest
1111
from dbt.contracts.results import RunResultsArtifact, FreshnessExecutionResultArtifact
@@ -47,7 +47,7 @@ class RuntimeArgs:
4747

4848

4949
def load_dbt_project_contract(project_dir: str) -> ProjectContract:
50-
partial_project = Project.partial_load(project_dir)
50+
partial_project = PartialProject.from_project_root(project_dir)
5151
contract = ProjectContract.from_dict(partial_project.project_dict)
5252
if not hasattr(contract, "model_paths") or contract.model_paths is None:
5353
setattr(contract, "model_paths", contract.source_paths)

projects/adapter/src/fal/dbt/integration/project.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,7 @@ class CompileArgs:
436436
models: List[str]
437437
exclude: Tuple[str]
438438
state: Optional[Path]
439+
defer_state: Optional[Path]
439440
single_threaded: Optional[bool]
440441

441442

@@ -453,6 +454,7 @@ def __init__(
453454
selector: Optional[str] = None,
454455
threads: Optional[int] = None,
455456
state: Optional[str] = None,
457+
defer_state: Optional[str] = None,
456458
profile_target: Optional[str] = None,
457459
args_vars: str = "{}",
458460
generated_models: Dict[str, Path] = {},
@@ -485,9 +487,13 @@ def __init__(
485487
self.profiles_dir = flags.PROFILES_DIR
486488

487489
self._state = None
490+
self._defer_state = None
488491
if state is not None:
489492
self._state = Path(os.path.realpath(os.path.expanduser(state)))
490493

494+
if defer_state is not None:
495+
self._defer_state = Path(os.path.realpath(os.path.expanduser(defer_state)))
496+
491497
self.scripts_dir = parse.get_scripts_dir(self.project_dir, args_vars)
492498

493499

@@ -525,7 +531,7 @@ def __init__(
525531
# Necessary for manifest loading to not fail
526532
# dbt.tracking.initialize_tracking(self.profiles_dir)
527533

528-
args = CompileArgs(selector, select, select, exclude, self._state, None)
534+
args = CompileArgs(selector, select, select, exclude, self._state, self._defer_state, None)
529535
self._compile_task = CompileTask(args, self._config, native_manifest)
530536

531537
self._compile_task._runtime_initialize()

0 commit comments

Comments
 (0)