Skip to content

Commit

Permalink
fix: airflow metadata (#498)
Browse files Browse the repository at this point in the history
* Add example pipeline entry to metadata declaration

Signed-off-by: Ahdra Merali <[email protected]>

* Fix entry

Signed-off-by: Ahdra Merali <[email protected]>

* Make entries consistent

Signed-off-by: Ahdra Merali <[email protected]>

* Add tools to config

Signed-off-by: Ahdra Merali <[email protected]>

* fix: telemetry metadata (#495)

---------

Signed-off-by: Dmitry Sorokin <[email protected]>
Signed-off-by: Ahdra Merali <[email protected]>

* Revert "Add tools to config"

This reverts commit 14732d7.

Signed-off-by: Ahdra Merali <[email protected]>

* Quick fix

Signed-off-by: Ahdra Merali <[email protected]>

* Lint

Signed-off-by: Ahdra Merali <[email protected]>

* Remove outdated config key

Signed-off-by: Ahdra Merali <[email protected]>

* Use kedro new instead of cookiecutter

Signed-off-by: Ahdra Merali <[email protected]>

---------

Signed-off-by: Ahdra Merali <[email protected]>
Signed-off-by: Dmitry Sorokin <[email protected]>
Co-authored-by: Dmitry Sorokin <[email protected]>
  • Loading branch information
AhdraMeraliQB and DimedS authored Jan 4, 2024
1 parent ad67ae9 commit 94019fd
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 26 deletions.
48 changes: 23 additions & 25 deletions kedro-airflow/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@
from shutil import copyfile

from click.testing import CliRunner
from cookiecutter.main import cookiecutter
from kedro import __version__ as kedro_version
from kedro.framework.cli.starters import TEMPLATE_PATH
from kedro.framework.cli.starters import create_cli as kedro_cli
from kedro.framework.startup import ProjectMetadata
from pytest import fixture

Expand Down Expand Up @@ -43,21 +42,19 @@ def _create_kedro_settings_py(file_name: Path, patterns: list[str]):

@fixture(scope="session")
def kedro_project(cli_runner):
tmp_path = Path().cwd()
# From `kedro-mlflow.tests.conftest.py`
config = {
"output_dir": tmp_path,
"kedro_version": kedro_version,
"project_name": "This is a fake project",
"repo_name": "fake-project",
"python_package": "fake_project",
"include_example": True,
}
cookiecutter(
str(TEMPLATE_PATH),
output_dir=config["output_dir"],
no_input=True,
extra_context=config,
CliRunner().invoke(
# Supply name, tools, and example to skip interactive prompts
kedro_cli,
[
"new",
"-v",
"--name",
"Fake Project",
"--tools",
"none",
"--example",
"no",
],
)
pipeline_registry_py = """
from kedro.pipeline import Pipeline, node
Expand All @@ -81,7 +78,7 @@ def register_pipelines():
}
"""

project_path = tmp_path / "fake-project"
project_path = Path().cwd() / "fake-project"
(project_path / "src" / "fake_project" / "pipeline_registry.py").write_text(
pipeline_registry_py
)
Expand All @@ -100,11 +97,12 @@ def metadata(kedro_project):
# cwd() depends on ^ the isolated filesystem, created by CliRunner()
project_path = kedro_project
return ProjectMetadata(
project_path / "pyproject.toml",
"hello_world",
"Hello world !!!",
project_path,
project_path / "src",
kedro_version,
"none",
source_dir=project_path / "src",
config_file=project_path / "pyproject.toml",
package_name="hello_world",
project_name="Hello world !!!",
kedro_init_version=kedro_version,
project_path=project_path,
tools=["None"],
example_pipeline="No",
)
1 change: 0 additions & 1 deletion kedro-docker/features/steps/cli_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ def create_configuration_file(context):
"repo_name": context.project_name,
"output_dir": str(context.temp_dir),
"python_package": context.project_name.replace("-", "_"),
"include_example": True,
}
with context.config_file.open("w") as config_file:
yaml.dump(config, config_file, default_flow_style=False)
Expand Down

0 comments on commit 94019fd

Please sign in to comment.