fal 0.9.2__py3-none-any.whl → 0.9.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of fal might be problematic. Click here for more details.

Files changed (93) hide show
  1. _fal_testing/utils.py +2 -2
  2. dbt/adapters/fal/__init__.py +21 -0
  3. dbt/adapters/fal/__version__.py +1 -0
  4. dbt/adapters/fal/connections.py +18 -0
  5. dbt/adapters/fal/impl.py +93 -0
  6. dbt/adapters/fal/load_db_profile.py +80 -0
  7. dbt/adapters/fal/wrappers.py +113 -0
  8. dbt/adapters/fal_experimental/__init__.py +11 -0
  9. dbt/adapters/fal_experimental/__version__.py +1 -0
  10. dbt/adapters/fal_experimental/adapter.py +149 -0
  11. dbt/adapters/fal_experimental/adapter_support.py +234 -0
  12. dbt/adapters/fal_experimental/connections.py +72 -0
  13. dbt/adapters/fal_experimental/impl.py +240 -0
  14. dbt/adapters/fal_experimental/support/athena.py +92 -0
  15. dbt/adapters/fal_experimental/support/bigquery.py +74 -0
  16. dbt/adapters/fal_experimental/support/duckdb.py +28 -0
  17. dbt/adapters/fal_experimental/support/postgres.py +88 -0
  18. dbt/adapters/fal_experimental/support/redshift.py +56 -0
  19. dbt/adapters/fal_experimental/support/snowflake.py +76 -0
  20. dbt/adapters/fal_experimental/support/trino.py +26 -0
  21. dbt/adapters/fal_experimental/telemetry/__init__.py +1 -0
  22. dbt/adapters/fal_experimental/telemetry/telemetry.py +411 -0
  23. dbt/adapters/fal_experimental/teleport.py +192 -0
  24. dbt/adapters/fal_experimental/teleport_adapter_support.py +23 -0
  25. dbt/adapters/fal_experimental/teleport_support/duckdb.py +122 -0
  26. dbt/adapters/fal_experimental/teleport_support/snowflake.py +72 -0
  27. dbt/adapters/fal_experimental/utils/__init__.py +50 -0
  28. dbt/adapters/fal_experimental/utils/environments.py +302 -0
  29. dbt/fal/adapters/python/__init__.py +3 -0
  30. dbt/fal/adapters/python/connections.py +319 -0
  31. dbt/fal/adapters/python/impl.py +291 -0
  32. dbt/fal/adapters/teleport/__init__.py +3 -0
  33. dbt/fal/adapters/teleport/impl.py +103 -0
  34. dbt/fal/adapters/teleport/info.py +73 -0
  35. dbt/include/fal/__init__.py +3 -0
  36. dbt/include/fal/dbt_project.yml +5 -0
  37. dbt/include/fal/macros/materializations/table.sql +46 -0
  38. dbt/include/fal/macros/teleport_duckdb.sql +8 -0
  39. dbt/include/fal/macros/teleport_snowflake.sql +31 -0
  40. dbt/include/fal_experimental/__init__.py +3 -0
  41. dbt/include/fal_experimental/dbt_project.yml +5 -0
  42. dbt/include/fal_experimental/macros/materializations/table.sql +36 -0
  43. fal/__init__.py +61 -11
  44. fal/dbt/__init__.py +11 -0
  45. fal/dbt/cli/__init__.py +1 -0
  46. fal/{cli → dbt/cli}/args.py +7 -2
  47. fal/{cli → dbt/cli}/cli.py +18 -3
  48. fal/{cli → dbt/cli}/dbt_runner.py +1 -1
  49. fal/{cli → dbt/cli}/fal_runner.py +6 -6
  50. fal/{cli → dbt/cli}/flow_runner.py +9 -9
  51. fal/{cli → dbt/cli}/model_generator/model_generator.py +5 -5
  52. fal/{cli → dbt/cli}/selectors.py +2 -2
  53. fal/{fal_script.py → dbt/fal_script.py} +4 -4
  54. {faldbt → fal/dbt/integration}/lib.py +2 -2
  55. {faldbt → fal/dbt/integration}/magics.py +2 -2
  56. {faldbt → fal/dbt/integration}/parse.py +7 -7
  57. {faldbt → fal/dbt/integration}/project.py +7 -7
  58. fal/dbt/integration/utils/yaml_helper.py +80 -0
  59. fal/dbt/new/project.py +43 -0
  60. fal/{node_graph.py → dbt/node_graph.py} +2 -2
  61. fal/{packages → dbt/packages}/dependency_analysis.py +32 -38
  62. fal/{packages → dbt/packages}/environments/__init__.py +3 -3
  63. fal/{packages → dbt/packages}/environments/base.py +2 -2
  64. fal/{packages → dbt/packages}/environments/conda.py +3 -3
  65. fal/{packages → dbt/packages}/environments/virtual_env.py +3 -3
  66. fal/{packages → dbt/packages}/isolated_runner.py +5 -5
  67. fal/{planner → dbt/planner}/executor.py +4 -4
  68. fal/{planner → dbt/planner}/plan.py +3 -3
  69. fal/{planner → dbt/planner}/schedule.py +5 -5
  70. fal/{planner → dbt/planner}/tasks.py +5 -5
  71. fal/{telemetry → dbt/telemetry}/telemetry.py +4 -4
  72. fal/{typing.py → dbt/typing.py} +2 -2
  73. fal/{utils.py → dbt/utils.py} +2 -2
  74. {fal-0.9.2.dist-info → fal-0.9.4.dist-info}/METADATA +98 -117
  75. fal-0.9.4.dist-info/RECORD +91 -0
  76. fal-0.9.4.dist-info/entry_points.txt +4 -0
  77. fal/cli/__init__.py +0 -1
  78. fal-0.9.2.dist-info/RECORD +0 -47
  79. fal-0.9.2.dist-info/entry_points.txt +0 -3
  80. {faldbt → dbt/adapters/fal_experimental}/utils/yaml_helper.py +0 -0
  81. /fal/{cli → dbt/cli}/model_generator/__init__.py +0 -0
  82. /fal/{cli → dbt/cli}/model_generator/module_check.py +0 -0
  83. /fal/{feature_store → dbt/feature_store}/__init__.py +0 -0
  84. /fal/{feature_store → dbt/feature_store}/feature.py +0 -0
  85. /fal/{packages → dbt/integration}/__init__.py +0 -0
  86. {faldbt → fal/dbt/integration}/logger.py +0 -0
  87. /fal/{planner → dbt/integration/utils}/__init__.py +0 -0
  88. {faldbt → fal/dbt/integration}/version.py +0 -0
  89. /fal/{telemetry → dbt/packages}/__init__.py +0 -0
  90. /fal/{packages → dbt/packages}/bridge.py +0 -0
  91. {faldbt → fal/dbt/planner}/__init__.py +0 -0
  92. {faldbt/utils → fal/dbt/telemetry}/__init__.py +0 -0
  93. {fal-0.9.2.dist-info → fal-0.9.4.dist-info}/WHEEL +0 -0
@@ -14,7 +14,7 @@ from typing import (
14
14
  from pathlib import Path
15
15
  from deprecation import deprecated
16
16
 
17
- import faldbt.version as version
17
+ import fal.dbt.integration.version as version
18
18
 
19
19
  from dbt.cli.resolvers import default_profiles_dir
20
20
  from dbt.cli.main import dbtRunner, dbtRunnerResult
@@ -49,16 +49,16 @@ from . import parse
49
49
  from . import lib
50
50
  from . import version
51
51
 
52
- from fal.feature_store.feature import Feature
52
+ from fal.dbt.feature_store.feature import Feature
53
53
 
54
54
  import pandas as pd
55
55
 
56
- from fal.telemetry import telemetry
57
- from fal.utils import has_side_effects
56
+ from fal.dbt.telemetry import telemetry
57
+ from fal.dbt.utils import has_side_effects
58
58
 
59
59
  if TYPE_CHECKING:
60
- from fal.fal_script import Hook, TimingType
61
- from fal.packages.environments import BaseEnvironment
60
+ from fal.dbt.fal_script import Hook, TimingType
61
+ from fal.dbt.packages.environments import BaseEnvironment
62
62
 
63
63
 
64
64
  class FalGeneralException(Exception):
@@ -252,7 +252,7 @@ class DbtModel(_DbtTestableNode):
252
252
  self,
253
253
  hook_type: "TimingType",
254
254
  ) -> List["Hook"]:
255
- from fal.fal_script import create_hook, TimingType
255
+ from fal.dbt.fal_script import create_hook, TimingType
256
256
 
257
257
  meta = self.meta or {}
258
258
 
@@ -0,0 +1,80 @@
1
+ from typing import Any, Dict, Optional
2
+ import yaml
3
+ import yaml.scanner
4
+
5
+ # the C version is faster, but it doesn't always exist
6
+ try:
7
+ from yaml import CLoader as Loader, CSafeLoader as SafeLoader, CDumper as Dumper
8
+ except ImportError:
9
+ from yaml import Loader, SafeLoader, Dumper # type: ignore # noqa: F401
10
+
11
+
12
+ YAML_ERROR_MESSAGE = """
13
+ Syntax error near line {line_number}
14
+ ------------------------------
15
+ {nice_error}
16
+
17
+ Raw Error:
18
+ ------------------------------
19
+ {raw_error}
20
+ """.strip()
21
+
22
+
23
+ def line_no(i, line, width=3):
24
+ line_number = str(i).ljust(width)
25
+ return "{}| {}".format(line_number, line)
26
+
27
+
28
+ def prefix_with_line_numbers(string, no_start, no_end):
29
+ line_list = string.split("\n")
30
+
31
+ numbers = range(no_start, no_end)
32
+ relevant_lines = line_list[no_start:no_end]
33
+
34
+ return "\n".join(
35
+ [line_no(i + 1, line) for (i, line) in zip(numbers, relevant_lines)]
36
+ )
37
+
38
+
39
+ def contextualized_yaml_error(raw_contents, error):
40
+ mark = error.problem_mark
41
+
42
+ min_line = max(mark.line - 3, 0)
43
+ max_line = mark.line + 4
44
+
45
+ nice_error = prefix_with_line_numbers(raw_contents, min_line, max_line)
46
+
47
+ return YAML_ERROR_MESSAGE.format(
48
+ line_number=mark.line + 1, nice_error=nice_error, raw_error=error
49
+ )
50
+
51
+
52
+ def safe_load(contents) -> Dict[str, Any]:
53
+ return yaml.load(contents, Loader=SafeLoader)
54
+
55
+
56
+ def load_yaml_text(contents):
57
+ try:
58
+ return safe_load(contents)
59
+ except (yaml.scanner.ScannerError, yaml.YAMLError) as e:
60
+ if hasattr(e, "problem_mark"):
61
+ error = contextualized_yaml_error(contents, e)
62
+ else:
63
+ error = str(e)
64
+
65
+ raise Exception(error)
66
+
67
+
68
+ def _load_file_contents(path: str, strip: bool = True) -> str:
69
+ with open(path, "rb") as handle:
70
+ to_return = handle.read().decode("utf-8")
71
+
72
+ if strip:
73
+ to_return = to_return.strip()
74
+
75
+ return to_return
76
+
77
+
78
+ def load_yaml(path):
79
+ contents = _load_file_contents(path)
80
+ return load_yaml_text(contents)
fal/dbt/new/project.py ADDED
@@ -0,0 +1,43 @@
1
+ from typing import Optional, List, cast
2
+ from dbt.cli.main import dbtRunner, dbtRunnerResult
3
+
4
+ class falProject:
5
+ """
6
+ Represents a dbt project and access to its resources and utility functions.
7
+ """
8
+
9
+ def _dbt_invoke(
10
+ self, cmd: str, args: Optional[List[str]] = None
11
+ ) -> dbtRunnerResult:
12
+ if args is None:
13
+ args = []
14
+
15
+ project_args = [
16
+ "--project-dir",
17
+ self.project_dir,
18
+ "--profiles-dir",
19
+ self.profiles_dir,
20
+ ]
21
+ if self.target_name:
22
+ project_args.extend(["--target", self.target_name])
23
+
24
+ # TODO: Intervene the dbt logs and capture them to avoid printing them to the console
25
+ return self._runner.invoke([cmd] + project_args + args)
26
+
27
+ def __init__(
28
+ self, project_dir: str, profiles_dir: str, target_name: Optional[str] = None
29
+ ):
30
+ # TODO: Make project_dir and profiles_dir optional and use the current working directory and default profiles dir?
31
+ self.project_dir = project_dir
32
+ self.profiles_dir = profiles_dir
33
+ self.target_name = target_name
34
+
35
+ # Load the manifest information
36
+ self._runner = dbtRunner()
37
+ parse_result = self._dbt_invoke("parse")
38
+ native_manifest = cast(Manifest, parse_result.result) # type: ignore
39
+ self._manifest = native_manifest
40
+ # self._manifest = DbtManifest(native_manifest)
41
+
42
+ # TODO: Do we need the manifest in there?
43
+ self._runner = dbtRunner(manifest=native_manifest)
@@ -2,8 +2,8 @@ from __future__ import annotations
2
2
  from dataclasses import dataclass
3
3
  from typing import List, Tuple, Dict, cast
4
4
 
5
- from fal.fal_script import FalScript, TimingType
6
- from faldbt.project import DbtModel, FalDbt
5
+ from fal.dbt.fal_script import FalScript, TimingType
6
+ from fal.dbt.integration.project import DbtModel, FalDbt
7
7
  from pathlib import Path
8
8
  import networkx as nx
9
9
  import os as os
@@ -5,13 +5,13 @@ from typing import Iterator, List, Optional, Tuple
5
5
 
6
6
  import importlib_metadata
7
7
 
8
- from fal.utils import cache_static
8
+ from fal.dbt.utils import cache_static
9
9
 
10
10
  import importlib_metadata
11
11
 
12
12
 
13
13
  def _get_project_root_path(pacakge: str) -> Path:
14
- import fal
14
+ import fal.dbt as fal
15
15
 
16
16
  # If this is a development version, we'll install
17
17
  # the current fal itself.
@@ -41,17 +41,12 @@ def _get_dbt_packages() -> Iterator[Tuple[str, Optional[str]]]:
41
41
  if dbt_plugin_name == "dbt-core":
42
42
  continue
43
43
 
44
- # Handle dbt-fal separately (since it needs to be installed
45
- # with its extras).
44
+ # Skip dbt-fal since it is already handled by _get_dbt_fal_package_name
46
45
  if dbt_plugin_name == "dbt-fal":
47
46
  continue
48
47
 
49
48
  yield dbt_plugin_name, distribution.version
50
49
 
51
- package_info = _get_dbt_fal_package_name()
52
- if package_info:
53
- yield package_info
54
-
55
50
 
56
51
  def _find_fal_extras(package: str) -> set[str]:
57
52
  # Return a possible set of extras that might be required when installing
@@ -86,8 +81,8 @@ def _find_fal_extras(package: str) -> set[str]:
86
81
  # the smallest possible subset of extras that we can install.
87
82
  return available_dbt_adapters.intersection(all_extras)
88
83
 
89
- def _is_fal_pre_release() -> bool:
90
- raw_fal_version = importlib_metadata.version("fal")
84
+ def _running_pre_release() -> bool:
85
+ raw_fal_version = importlib_metadata.version("dbt-fal")
91
86
  return _version_is_prerelease(raw_fal_version)
92
87
 
93
88
  def _version_is_prerelease(raw_version: str) -> bool:
@@ -96,43 +91,42 @@ def _version_is_prerelease(raw_version: str) -> bool:
96
91
  package_version = Version(raw_version)
97
92
  return package_version.is_prerelease
98
93
 
99
- def _get_dbt_fal_package_name() -> Optional[Tuple[str, Optional[str]]]:
100
- try:
101
- dbt_fal_version = importlib_metadata.version("dbt-fal")
102
- except importlib_metadata.PackageNotFoundError:
103
- # It might not be installed.
104
- return None
105
-
106
- if _is_fal_pre_release():
107
- dbt_fal_dep = str(_get_project_root_path("adapter"))
108
- # We are going to install it from the local path.
109
- dbt_fal_version = None
94
+ def _get_dbt_fal_package() -> Tuple[str, Optional[str]]:
95
+ if _running_pre_release():
96
+ proj_path = _get_project_root_path("adapter")
97
+ if proj_path.exists():
98
+ # We are going to install it from the local path.
99
+ dbt_fal_dep = str(proj_path)
100
+ dbt_fal_version = None
101
+ else:
102
+ # We are going to install it from PyPI.
103
+ dbt_fal_dep = "dbt-fal"
104
+ try:
105
+ dbt_fal_version = importlib_metadata.version("dbt-fal")
106
+ except importlib_metadata.PackageNotFoundError:
107
+ # TODO: remove once `fal` is no longer a supported package
108
+ dbt_fal_version = importlib_metadata.version("fal")
110
109
  else:
111
110
  dbt_fal_dep = "dbt-fal"
111
+ try:
112
+ dbt_fal_version = importlib_metadata.version("dbt-fal")
113
+ except importlib_metadata.PackageNotFoundError:
114
+ # TODO: remove once `fal` is no longer a supported package
115
+ dbt_fal_version = importlib_metadata.version("fal")
116
+
117
+ try:
118
+ dbt_fal_extras = _find_fal_extras("dbt-fal")
119
+ except importlib_metadata.PackageNotFoundError:
120
+ # TODO: remove once `fal` is no longer a supported package
121
+ dbt_fal_extras = _find_fal_extras("fal")
112
122
 
113
- dbt_fal_extras = _find_fal_extras("dbt-fal")
114
123
  if dbt_fal_extras:
115
124
  dbt_fal_dep += f"[{','.join(dbt_fal_extras)}]"
116
125
 
117
126
  return dbt_fal_dep, dbt_fal_version
118
127
 
119
- def _get_fal_package_name() -> Tuple[str, Optional[str]]:
120
- if _is_fal_pre_release():
121
- fal_dep = str(_get_project_root_path("fal"))
122
- fal_version = None
123
- else:
124
- fal_dep = "fal"
125
- fal_version = importlib_metadata.version("fal")
126
-
127
- fal_extras = _find_fal_extras("fal")
128
- if fal_extras:
129
- fal_dep += f"[{','.join(fal_extras)}]"
130
-
131
- return fal_dep, fal_version
132
-
133
-
134
128
  def get_default_requirements() -> Iterator[Tuple[str, Optional[str]]]:
135
- yield _get_fal_package_name()
129
+ yield _get_dbt_fal_package()
136
130
  yield from _get_dbt_packages()
137
131
 
138
132
 
@@ -1,9 +1,9 @@
1
1
  from pathlib import Path
2
2
  from typing import List, Optional, Dict, Any
3
3
 
4
- from fal.packages.environments.base import BASE_CACHE_DIR, BaseEnvironment
5
- from fal.packages.environments.conda import CondaEnvironment
6
- from fal.packages.environments.virtual_env import VirtualPythonEnvironment
4
+ from fal.dbt.packages.environments.base import BASE_CACHE_DIR, BaseEnvironment
5
+ from fal.dbt.packages.environments.conda import CondaEnvironment
6
+ from fal.dbt.packages.environments.virtual_env import VirtualPythonEnvironment
7
7
 
8
8
  REGISTERED_ENVIRONMENTS: Dict[str, BaseEnvironment] = {
9
9
  "conda": CondaEnvironment,
@@ -13,8 +13,8 @@ from typing import Any, Callable, ContextManager, Generic, Iterator, TypeVar, Di
13
13
 
14
14
  from platformdirs import user_cache_dir
15
15
 
16
- from faldbt.logger import LOGGER
17
- from fal.packages import bridge, isolated_runner
16
+ from fal.dbt.integration.logger import LOGGER
17
+ from fal.dbt.packages import bridge, isolated_runner
18
18
 
19
19
  BASE_CACHE_DIR = Path(user_cache_dir("fal", "fal"))
20
20
  BASE_CACHE_DIR.mkdir(exist_ok=True)
@@ -10,15 +10,15 @@ from dataclasses import dataclass
10
10
  from pathlib import Path
11
11
  from typing import List, Dict, Any
12
12
 
13
- from fal.packages.environments.base import (
13
+ from fal.dbt.packages.environments.base import (
14
14
  BASE_CACHE_DIR,
15
15
  BaseEnvironment,
16
16
  DualPythonIPC,
17
17
  log_env,
18
18
  rmdir_on_fail,
19
19
  )
20
- from fal.packages.environments.virtual_env import get_primary_virtual_env
21
- from fal.utils import cache_static
20
+ from fal.dbt.packages.environments.virtual_env import get_primary_virtual_env
21
+ from fal.dbt.utils import cache_static
22
22
 
23
23
  _BASE_CONDA_DIR = BASE_CACHE_DIR / "conda"
24
24
  _BASE_CONDA_DIR.mkdir(exist_ok=True)
@@ -7,8 +7,8 @@ from dataclasses import dataclass, field
7
7
  from pathlib import Path
8
8
  from typing import List, Dict, Any
9
9
 
10
- from fal.packages.dependency_analysis import get_default_pip_dependencies
11
- from fal.packages.environments.base import (
10
+ from fal.dbt.packages.dependency_analysis import get_default_pip_dependencies
11
+ from fal.dbt.packages.environments.base import (
12
12
  BASE_CACHE_DIR,
13
13
  BaseEnvironment,
14
14
  DualPythonIPC,
@@ -17,7 +17,7 @@ from fal.packages.environments.base import (
17
17
  python_path_for,
18
18
  rmdir_on_fail,
19
19
  )
20
- from fal.utils import cache_static
20
+ from fal.dbt.utils import cache_static
21
21
 
22
22
  _BASE_VENV_DIR = BASE_CACHE_DIR / "venvs"
23
23
  _BASE_VENV_DIR.mkdir(exist_ok=True)
@@ -36,8 +36,8 @@ DEBUG_TIMEOUT = 60 * 15
36
36
 
37
37
 
38
38
  def run_client(address: str, *, with_pdb: bool = False) -> int:
39
- from faldbt.logger import LOGGER
40
- from fal.packages import bridge
39
+ from fal.dbt.integration.logger import LOGGER
40
+ from fal.dbt.packages import bridge
41
41
 
42
42
  if with_pdb:
43
43
  # This condition will only be activated if we want to
@@ -88,8 +88,8 @@ def _get_shell_bootstrap() -> str:
88
88
 
89
89
 
90
90
  def _fal_main() -> None:
91
- from faldbt.logger import LOGGER
92
- from fal.packages import bridge
91
+ from fal.dbt.integration.logger import LOGGER
92
+ from fal.dbt.packages import bridge
93
93
 
94
94
  LOGGER.debug("Starting the isolated process at PID {}", os.getpid())
95
95
 
@@ -125,7 +125,7 @@ def _process_primary_env_packages() -> None:
125
125
  def main():
126
126
  _process_primary_env_packages()
127
127
 
128
- from faldbt.logger import log_manager
128
+ from fal.dbt.integration.logger import log_manager
129
129
 
130
130
  # TODO: do we still need this?
131
131
  with log_manager.applicationbound():
@@ -10,8 +10,8 @@ from concurrent.futures import (
10
10
  from dataclasses import dataclass, field
11
11
  from typing import Iterator, List, Optional
12
12
 
13
- from fal.planner.schedule import SUCCESS, Scheduler
14
- from fal.planner.tasks import (
13
+ from fal.dbt.planner.schedule import SUCCESS, Scheduler
14
+ from fal.dbt.planner.tasks import (
15
15
  TaskGroup,
16
16
  Task,
17
17
  Status,
@@ -19,9 +19,9 @@ from fal.planner.tasks import (
19
19
  FalLocalHookTask,
20
20
  HookType,
21
21
  )
22
- from faldbt.project import FalDbt
22
+ from fal.dbt.integration.project import FalDbt
23
23
 
24
- from faldbt.logger import LOGGER
24
+ from fal.dbt.integration.logger import LOGGER
25
25
 
26
26
 
27
27
  class State(Enum):
@@ -3,9 +3,9 @@ from __future__ import annotations
3
3
  from typing import Callable, Iterator, List, Set
4
4
 
5
5
  import networkx as nx
6
- from fal.node_graph import NodeKind
7
- from fal.cli.selectors import ExecutionPlan, _is_before_script, _is_after_script
8
- from faldbt.logger import LOGGER
6
+ from fal.dbt.node_graph import NodeKind
7
+ from fal.dbt.cli.selectors import ExecutionPlan, _is_before_script, _is_after_script
8
+ from fal.dbt.integration.logger import LOGGER
9
9
  from dataclasses import dataclass
10
10
 
11
11
 
@@ -6,9 +6,9 @@ from typing import Iterator, List, Optional
6
6
 
7
7
  import networkx as nx
8
8
 
9
- from faldbt.project import DbtModel
10
- from fal.node_graph import DbtModelNode, NodeGraph, NodeKind, ScriptNode
11
- from fal.planner.tasks import (
9
+ from fal.dbt.integration.project import DbtModel
10
+ from fal.dbt.node_graph import DbtModelNode, NodeGraph, NodeKind, ScriptNode
11
+ from fal.dbt.planner.tasks import (
12
12
  SUCCESS,
13
13
  Task,
14
14
  DBTTask,
@@ -19,8 +19,8 @@ from fal.planner.tasks import (
19
19
  Status,
20
20
  HookType,
21
21
  )
22
- from fal.utils import DynamicIndexProvider
23
- from fal.fal_script import Hook, IsolatedHook, create_hook, TimingType
22
+ from fal.dbt.utils import DynamicIndexProvider
23
+ from fal.dbt.fal_script import Hook, IsolatedHook, create_hook, TimingType
24
24
 
25
25
 
26
26
  def create_hook_task(
@@ -13,11 +13,11 @@ from dataclasses import dataclass, field
13
13
  from enum import Enum, auto
14
14
  from typing import Iterator, List, Any, Optional, Dict, Tuple, Union
15
15
 
16
- from faldbt.logger import LOGGER
16
+ from fal.dbt.integration.logger import LOGGER
17
17
 
18
- from fal.fal_script import FalScript, TimingType
19
- from fal.utils import print_run_info, DynamicIndexProvider
20
- from faldbt.project import DbtModel, FalDbt, NodeStatus
18
+ from fal.dbt.fal_script import FalScript, TimingType
19
+ from fal.dbt.utils import print_run_info, DynamicIndexProvider
20
+ from fal.dbt.integration.project import DbtModel, FalDbt, NodeStatus
21
21
 
22
22
  from datetime import datetime, timezone
23
23
 
@@ -162,7 +162,7 @@ class DBTTask(Task):
162
162
  model_ids: List[str]
163
163
 
164
164
  def execute(self, args: argparse.Namespace, fal_dbt: FalDbt) -> int:
165
- from fal.cli.dbt_runner import dbt_run_through_python
165
+ from fal.dbt.cli.dbt_runner import dbt_run_through_python
166
166
 
167
167
  model_names = _unique_ids_to_model_names(self.model_ids)
168
168
  output = dbt_run_through_python(
@@ -24,7 +24,7 @@ import inspect
24
24
  from contextlib import contextmanager
25
25
  from dbt.config.runtime import RuntimeConfig
26
26
 
27
- from fal.utils import cache_static
27
+ from fal.dbt.utils import cache_static
28
28
 
29
29
  import platform
30
30
 
@@ -127,7 +127,7 @@ def get_dbt_adapter_type(config: RuntimeConfig | None) -> str | None:
127
127
  def fal_installed_version():
128
128
  """Returns: fal version"""
129
129
  try:
130
- return pkg_resources.get_distribution("fal").version
130
+ return pkg_resources.get_distribution("dbt-fal").version
131
131
  except ImportError:
132
132
  return
133
133
 
@@ -242,8 +242,8 @@ def write_conf_file(conf_path, to_write, error=None):
242
242
  def get_dbt_config():
243
243
  try:
244
244
  from dbt.flags import PROFILES_DIR
245
- from fal.cli.args import parse_args
246
- from faldbt.parse import get_dbt_config
245
+ from fal.dbt.cli.args import parse_args
246
+ from fal.dbt.integration.parse import get_dbt_config
247
247
 
248
248
  args = parse_args(sys.argv[1:])
249
249
 
@@ -7,8 +7,8 @@ from typing import TYPE_CHECKING
7
7
  if TYPE_CHECKING:
8
8
  import pandas as pd
9
9
  from typing import Optional, Dict, List, Protocol, Any
10
- from faldbt.project import DbtModel, DbtTest, DbtSource, Feature
11
- from fal.fal_script import Context, CurrentModel
10
+ from fal.dbt.integration.project import DbtModel, DbtTest, DbtSource, Feature
11
+ from fal.dbt.fal_script import Context, CurrentModel
12
12
 
13
13
  class _List_Sources(Protocol):
14
14
  def __call__(self) -> List[DbtSource]:
@@ -1,6 +1,6 @@
1
1
  """Fal utilities."""
2
2
  import copy
3
- from faldbt.logger import LOGGER
3
+ from fal.dbt.integration.logger import LOGGER
4
4
  from typing import List, TYPE_CHECKING, TypeVar
5
5
 
6
6
  try:
@@ -9,7 +9,7 @@ except ImportError:
9
9
  from backports.functools_lru_cache import lru_cache
10
10
 
11
11
  if TYPE_CHECKING:
12
- from fal.fal_script import FalScript
12
+ from fal.dbt.fal_script import FalScript
13
13
 
14
14
 
15
15
  def print_run_info(scripts: List["FalScript"]):