Skip to content

Commit

Permalink
[dagster-airlift] rename peering to dbt example
Browse files Browse the repository at this point in the history
  • Loading branch information
dpeng817 committed Aug 12, 2024
1 parent 56db19d commit 08665b8
Show file tree
Hide file tree
Showing 43 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ def k8s_extra_cmds(version: str, _) -> List[str]:
],
),
PackageSpec(
"examples/experimental/dagster-airlift/examples/peering-with-dbt",
"examples/experimental/dagster-airlift/examples/dbt-example",
unsupported_python_versions=[
AvailablePythonVersion.V3_12,
],
Expand Down
2 changes: 1 addition & 1 deletion examples/experimental/dagster-airlift/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ defs = Definitions.merge(

The next step is to observe the assets that are orchestrated from Airflow. In order to do that we must create the corresponding definitions in the Dagster deployment.

We have an included example at `examples/experimental/dagster-airlift/examples/peering-with-dbt`. We suggest mimicking the structure of this project as a starting point.
We have an included example at `examples/experimental/dagster-airlift/examples/dbt-example`. We suggest mimicking the structure of this project as a starting point.

To add definitions that an Airlift-enabled deployment will observed, you need to use the `orchestrated_defs` argument to `build_defs_from_airflow_instance`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ endef
MAKEFILE_DIR := $(GET_MAKEFILE_DIR)
export DAGSTER_HOME := $(MAKEFILE_DIR)/.dagster_home
export AIRFLOW_HOME := $(MAKEFILE_DIR)/.airflow_home
export DBT_PROJECT_DIR := $(MAKEFILE_DIR)/peering_with_dbt/dbt
export DBT_PROFILES_DIR := $(MAKEFILE_DIR)/peering_with_dbt/dbt
export DBT_PROJECT_DIR := $(MAKEFILE_DIR)/dbt_example/dbt
export DBT_PROFILES_DIR := $(MAKEFILE_DIR)/dbt_example/dbt

help:
@egrep -h '\s##\s' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
Expand All @@ -28,14 +28,14 @@ setup_local_env:
mkdir -p $$AIRFLOW_HOME && \
mkdir -p $$DAGSTER_HOME && \
chmod +x ../../airflow_setup.sh && \
../../airflow_setup.sh $(MAKEFILE_DIR)/peering_with_dbt/airflow_dags && \
../../airflow_setup.sh $(MAKEFILE_DIR)/dbt_example/airflow_dags && \
make dbt_setup

run_airflow:
airflow standalone

run_dagster_dev:
dagster dev -m peering_with_dbt.dagster_defs -p 3333
dagster dev -m dbt_example.dagster_defs -p 3333

wipe: ## Wipe out all the files created by the Makefile
rm -rf $$AIRFLOW_HOME $$DAGSTER_HOME
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def local_env_fixture() -> Generator[None, None, None]:
with environ(
{
"AIRFLOW_HOME": str(makefile_dir / ".airflow_home"),
"DBT_PROJECT_DIR": str(makefile_dir / "peering_with_dbt" / "dbt"),
"DBT_PROJECT_DIR": str(makefile_dir / "dbt_example" / "dbt"),
"DAGSTER_HOME": str(makefile_dir / ".dagster_home"),
}
):
Expand All @@ -24,7 +24,7 @@ def local_env_fixture() -> Generator[None, None, None]:

@pytest.fixture(name="dags_dir")
def dags_dir_fixture() -> Path:
return Path(__file__).parent.parent / "peering_with_dbt" / "airflow_dags"
return Path(__file__).parent.parent / "dbt_example" / "airflow_dags"


@pytest.fixture(name="airflow_home")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
def test_defs_loads(airflow_instance):
from peering_with_dbt.dagster_defs import defs
from dbt_example.dagster_defs import defs

assert defs
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[tool.dagster]
module_name = "peering_with_dbt.definitions"
module_name = "dbt_example.definitions"
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def get_version() -> str:
pin = "" if ver == "1!0+dev" else f"=={ver}"

setup(
name="peering-with-dbt",
name="dbt-example",
packages=find_packages(),
install_requires=[
f"dagster{pin}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ allowlist_externals =
uv
commands =
!windows: /bin/bash -c '! pip list --exclude-editable | grep -e dagster'
pytest -c ../../../../../pyproject.toml ./peering_with_dbt_tests --snapshot-warn-unused -vv {posargs}
pytest -c ../../../../../pyproject.toml ./dbt_example_tests --snapshot-warn-unused -vv {posargs}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def local_env_fixture() -> Generator[None, None, None]:

@pytest.fixture(name="dags_dir")
def dags_dir_fixture() -> Path:
return Path(__file__).parent.parent / "peering_with_dbt" / "airflow_dags"
return Path(__file__).parent.parent / "dbt_example" / "airflow_dags"


@pytest.fixture(name="airflow_home")
Expand Down
2 changes: 1 addition & 1 deletion pyright/master/requirements-pinned.txt
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ path==16.16.0
pathable==0.4.3
pathspec==0.12.1
pathvalidate==3.2.0
-e examples/experimental/dagster-airlift/examples/peering-with-dbt
-e examples/experimental/dagster-airlift/examples/dbt-example
pendulum==2.1.2
pexpect==4.9.0
pillow==10.4.0
Expand Down
2 changes: 1 addition & 1 deletion pyright/master/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -129,5 +129,5 @@ pendulum<3
-e examples/with_wandb
-e examples/experimental/dagster-blueprints
-e examples/experimental/dagster-airlift[mwaa,dbt,test] # (includes airflow dependencies)
-e examples/experimental/dagster-airlift/examples/peering-with-dbt
-e examples/experimental/dagster-airlift/examples/dbt-example
-e examples/use_case_repository[dev]

0 comments on commit 08665b8

Please sign in to comment.