Skip to content

Commit 0cdf6fe

Browse files
committed
feat: use GeneratedCallables for handling console methods\n\n- Update console and backfilling integration\n- Support latest Dagster and SQLMesh versions\n- Exclude private README changes; keep upstream README\n\nRefs: opensource-observer#49, closes opensource-observer#43; follow-up to opensource-observer#52
1 parent 419abf6 commit 0cdf6fe

File tree

14 files changed

+1304
-128
lines changed

14 files changed

+1304
-128
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,5 @@ sample/dagster_project/storage/
6767
sample/dagster_project/logs/
6868
sample/dagster_project/history/
6969
sample/dagster_project/schedules/
70+
71+
.venv

dagster_sqlmesh/config.py

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ class SQLMeshContextConfig(Config):
3939
default="dagster_sqlmesh.translator.SQLMeshDagsterTranslator",
4040
description="Fully qualified class name of the SQLMesh Dagster translator to use"
4141
)
42+
virtual_environment_mode: str | None = Field(default=None)
43+
environment_catalog_mapping: dict[str, str] | None = Field(default=None)
44+
default_target_environment: str | None = Field(default=None)
4245

4346
def get_translator(self) -> "SQLMeshDagsterTranslator":
4447
"""Get a translator instance using the configured class name.
@@ -80,9 +83,21 @@ def get_translator(self) -> "SQLMeshDagsterTranslator":
8083
@property
8184
def sqlmesh_config(self) -> MeshConfig:
8285
if self.config_override:
83-
return MeshConfig.parse_obj(self.config_override)
84-
sqlmesh_path = Path(self.path)
85-
configs = load_configs(None, MeshConfig, [sqlmesh_path])
86-
if sqlmesh_path not in configs:
87-
raise ValueError(f"SQLMesh configuration not found at {sqlmesh_path}")
88-
return configs[sqlmesh_path]
86+
base_config = MeshConfig.parse_obj(self.config_override)
87+
else:
88+
sqlmesh_path = Path(self.path)
89+
configs = load_configs(None, MeshConfig, [sqlmesh_path])
90+
if sqlmesh_path not in configs:
91+
raise ValueError(f"SQLMesh configuration not found at {sqlmesh_path}")
92+
base_config = configs[sqlmesh_path]
93+
94+
config_dict = base_config.dict()
95+
96+
if self.virtual_environment_mode is not None:
97+
config_dict["virtual_environment_mode"] = self.virtual_environment_mode
98+
if self.environment_catalog_mapping is not None:
99+
config_dict["environment_catalog_mapping"] = self.environment_catalog_mapping
100+
if self.default_target_environment is not None:
101+
config_dict["default_target_environment"] = self.default_target_environment
102+
103+
return MeshConfig.parse_obj(config_dict)

dagster_sqlmesh/conftest.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import sys
55
import tempfile
66
import typing as t
7+
import warnings
78

89
import pytest
910

@@ -22,6 +23,26 @@ def setup_debug_logging_for_tests() -> None:
2223
root_logger.setLevel(logging.DEBUG)
2324

2425
logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)
26+
warnings.filterwarnings(
27+
"ignore",
28+
message="The argument 'infer_datetime_format' is deprecated",
29+
category=UserWarning,
30+
)
31+
warnings.filterwarnings(
32+
"ignore",
33+
message="errors='ignore' is deprecated",
34+
category=FutureWarning,
35+
)
36+
warnings.filterwarnings(
37+
"ignore",
38+
message="Support for class-based `config` is deprecated",
39+
category=DeprecationWarning,
40+
)
41+
warnings.filterwarnings(
42+
"ignore",
43+
message=r"This process .* is multi-threaded, use of fork\(\) may lead to deadlocks",
44+
category=DeprecationWarning,
45+
)
2546

2647

2748
@pytest.fixture

0 commit comments

Comments
 (0)