Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tools documentation page #3331

Merged
merged 81 commits into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from 68 commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
9e9449c
Revise link to notebook docs and remove unnecessary intro page
stichbury Oct 30, 2023
c5b5b0d
Update starters content
stichbury Oct 30, 2023
ce80d99
Merge branch 'develop' into fix-starters-content
stichbury Nov 16, 2023
3cee9f4
relocate starters content
stichbury Nov 16, 2023
124bd90
Added some changes for add-ons and some to do notes
stichbury Nov 16, 2023
b58d9a4
Merge branch 'develop' into fix-starters-content
stichbury Nov 16, 2023
f9062ce
Merge branch 'develop' into fix-starters-content
stichbury Nov 20, 2023
233a4de
Merge branch 'develop' into fix-starters-content
stichbury Nov 21, 2023
4abbdbb
Some further fixes
stichbury Nov 21, 2023
fb5c335
Merge branch 'develop' into fix-starters-content
stichbury Nov 21, 2023
ab9bcd9
Move section about development version of Kedro
stichbury Nov 21, 2023
b787664
Add text for new project
stichbury Nov 21, 2023
47f7e05
Merge branch 'fix-starters-content' of https://github.com/kedro-org/k…
stichbury Nov 21, 2023
cd7938e
Remove mention of pandas-iris where possible, replacing with alternative
stichbury Nov 21, 2023
8724441
Merge branch 'develop' into fix-starters-content
stichbury Nov 21, 2023
c4d8ed5
Fix linter errors
stichbury Nov 21, 2023
f7cbffa
Merge branch 'fix-starters-content' of https://github.com/kedro-org/k…
stichbury Nov 21, 2023
fc4aed5
Update new project docs
stichbury Nov 22, 2023
2349b7d
Merge branch 'develop' into fix-starters-content
AhdraMeraliQB Nov 22, 2023
bdf10a3
Remove deprecated starters from architecture diagram
stichbury Nov 22, 2023
6e678e6
Merge branch 'fix-starters-content' of https://github.com/kedro-org/k…
stichbury Nov 22, 2023
f2a8868
Add warning for pandas-iris usage in generator section
stichbury Nov 22, 2023
50b51c9
Further updates for instances of kedro new
stichbury Nov 22, 2023
5db4cad
Remove TODO as no longer required
Nov 22, 2023
b397ccf
Merge
Nov 22, 2023
d954d4a
Add outline
Nov 22, 2023
2122ee1
Merge branch 'develop' into docs/add-tools-page
AhdraMeraliQB Nov 23, 2023
61fe3f5
update docs, data, pyspark and viz information
SajidAlamQB Nov 27, 2023
8df93cc
add mermaid diagram
SajidAlamQB Nov 27, 2023
ac1f909
Flesh out docs
Nov 27, 2023
806f873
Merge with Sajid's changes
Nov 27, 2023
04f995a
Merge branch 'develop' into docs/add-tools-page
Nov 27, 2023
4ccbc09
Merge develop into docs/add-tools-page
Nov 27, 2023
4ee7d61
Merge develop into docs/add-tools-page
Nov 27, 2023
63188da
Merge develop into docs/add-tools-page
Nov 27, 2023
d36e7bd
Fix lint
Nov 27, 2023
0f1cbf4
Add suggestions from review
Nov 28, 2023
44b34ec
Some amends to docs
stichbury Nov 29, 2023
95df616
Merge branch 'develop' into docs/add-tools-page
stichbury Nov 29, 2023
f1ec33a
Merge branch 'develop' into docs/add-tools-page
AhdraMeraliQB Nov 29, 2023
7975581
Add warning about combining starter and tools/example flag
stichbury Nov 30, 2023
155b62d
Merge branch 'develop' into docs/add-tools-page
stichbury Nov 30, 2023
779056b
additional changes to ordering/content
stichbury Nov 30, 2023
def85b6
Merge branch 'docs/add-tools-page' of https://github.com/kedro-org/ke…
stichbury Nov 30, 2023
7f9fa2e
updated mermaid diagrams
SajidAlamQB Nov 30, 2023
59c0f80
Merge branch 'develop' into docs/add-tools-page
stichbury Nov 30, 2023
02add5d
Merge branch 'develop' into docs/add-tools-page
Nov 30, 2023
7510b41
Add images to placehoders
Nov 30, 2023
5fa6709
Merge branch 'develop' into docs/add-tools-page
stichbury Dec 1, 2023
3756c40
Update docs/source/starters/new_project_tools.md
stichbury Dec 1, 2023
625f3f6
Update docs/source/starters/new_project_tools.md
stichbury Dec 1, 2023
a1e7629
Update docs/source/starters/starters.md
stichbury Dec 1, 2023
f4ef58b
update docs
SajidAlamQB Dec 5, 2023
ced83ab
Add links and lint
Dec 5, 2023
6e8e839
Merge branch 'develop' into docs/add-tools-page
AhdraMeraliQB Dec 5, 2023
7485013
Include KEDRO_LOGGING_CONFIG in Custom Logging section
Dec 5, 2023
9fdf531
update data structure tools description
SajidAlamQB Dec 6, 2023
917b01f
add description of prokect examples and tidy up
SajidAlamQB Dec 6, 2023
94df766
Merge branch 'develop' into docs/add-tools-page
SajidAlamQB Dec 6, 2023
eb41d2d
Use customise consistently
Dec 6, 2023
d9a6651
Address comments from review
Dec 6, 2023
2320c48
Add details for config file options
Dec 6, 2023
7124c49
Merge branch 'develop' into docs/add-tools-page
AhdraMeraliQB Dec 6, 2023
9eaebe6
Update mentions of Pyspark to PySpark
Dec 6, 2023
169c6be
Clarify section introduction
Dec 6, 2023
3184404
Fill in placeholders
Dec 6, 2023
d48fee4
Add to selection syntax options
Dec 6, 2023
cd85154
Merge branch 'develop' into docs/add-tools-page
AhdraMeraliQB Dec 6, 2023
5aee632
Merge branch 'develop' into docs/add-tools-page
AhdraMeraliQB Dec 7, 2023
0eea424
changes based on review
SajidAlamQB Dec 7, 2023
da7f2b7
more detail to example code in new_project_tools
SajidAlamQB Dec 7, 2023
521124a
Merge branch 'develop' into docs/add-tools-page
SajidAlamQB Dec 7, 2023
124f5b8
lint
SajidAlamQB Dec 7, 2023
4360f7f
Clarify section headings
Dec 7, 2023
98d43cf
Add section links
Dec 7, 2023
f214577
Replace images with code snippets
Dec 7, 2023
c5c6d0f
Lint
Dec 7, 2023
d05f5eb
Merge branch 'develop' into docs/add-tools-page
AhdraMeraliQB Dec 7, 2023
06d6c1b
Merge branch 'develop' into docs/add-tools-page
AhdraMeraliQB Dec 8, 2023
a83a5a1
Remove syntax highlighting on text blocks
Dec 8, 2023
3826c51
Merge branch 'develop' into docs/add-tools-page
AhdraMeraliQB Dec 8, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 30 additions & 1 deletion docs/source/get_started/new_project.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,14 @@ You can add one or more of the options, or follow the default and add none at al

### Project examples

TO DO
The CLI offers the option to include example pipelines. Your choice of tools determines which spaceflights example starters are provided. Here's a guide to understanding which starter examples are used based on your selections:
SajidAlamQB marked this conversation as resolved.
Show resolved Hide resolved

* [Default Starter](https://github.com/kedro-org/kedro-starters/tree/main/spaceflights-pandas) (`spaceflights-pandas`): Used when you select any combination of Linting, Testing, Custom Logging, Documentation, and Data Structure, excluding PySpark and Kedro Viz.
* [PySpark Starter](https://github.com/kedro-org/kedro-starters/tree/main/spaceflights-pyspark) (`spaceflights-pyspark`): Chosen when PySpark is selected with any other tools, except Kedro Viz.
* [Kedro Viz Starter](https://github.com/kedro-org/kedro-starters/tree/main/spaceflights-pandas-viz) (`spaceflights-pandas-viz`): Applicable when Kedro Viz is part of your selection, with any other tools, excluding PySpark.
* [Full Feature Starter](https://github.com/kedro-org/kedro-starters/tree/main/spaceflights-pyspark-viz) (`spaceflights-pyspark-viz`): This example is used when you select all available tools, including PySpark and Kedro Viz.

Each starter example is tailored to demonstrate the capabilities and integrations of the selected tools, offering a practical insight into how they can be utilised in your project.

## Run the new project

Expand Down Expand Up @@ -92,3 +99,25 @@ You have completed the section on Kedro project creation for new users. Here are
* How-to guide for notebook users: The documentation section following the tutorial explains [how to combine Kedro with a Jupyter notebook](../notebooks_and_ipython/kedro_and_notebooks.md).

If you've worked through the documentation listed and are unsure where to go next, review the [Kedro repositories on GitHub](https://github.com/kedro-org) and [Kedro's Slack channels](https://slack.kedro.org).

## Flowchart of general choice of tools

Here is a flowchart to help guide your choice of tools and examples you can select:

```{mermaid}
:alt: General overview diagram for setting up a new Kedro project with tools
flowchart TD
A[Start] --> B[Enter Project Name];
B --> C[Select Tools];

C -->|None| D[None];
C -->|Any combination| E[lint, test, logging, docs, data, PySpark, viz];
C -->|All| F[All];

D --> G[Include Example Pipeline?]
E --> G;
F --> G

G -->|Yes| H[New Project Created];
G -->|No| H;
```
Binary file added docs/source/meta/images/kedro-new-help.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 13 additions & 5 deletions docs/source/starters/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# New project tools (title TBD)
As you saw from the [First steps](../get_started/new_project.md) section, once you have [set up Kedro](../get_started/install.md), you can use `kedro new` to create a basic Kedro project containing project directories and basic code, which you can configure depending on the tooling and example code you need.
# Customise a new project
As you saw from the [First steps](../get_started/new_project.md) section, once you have [set up Kedro](../get_started/install.md), you can create a new project with `kedro new` and customise the code added to that project for its tooling and example code requirements.

There are options to the code you include when you create a new Kedro project, which the pages in this section describe in detail.
The pages in this section describe in detail the various options available.

AhdraMeraliQB marked this conversation as resolved.
Show resolved Hide resolved
```{toctree}
:maxdepth: 1
Expand Down Expand Up @@ -29,7 +29,11 @@ The configuration file must contain:
* `project_name`
* `repo_name`
* `python_package`
* TO DO -- tools and example code options

Additionally, the configuration file may contain:

* `tools` The tools to customise your project setup with. Select from comma-separated values, ranges, or 'all/none'. Omitting this from your configuration file will result in the default selection of `none`.
* `example` Indicate `yes` or `no` to select whether you would like your project to be populated with example code. Omitting this from your configuration file will result in the default selection of `no`.
SajidAlamQB marked this conversation as resolved.
Show resolved Hide resolved

SajidAlamQB marked this conversation as resolved.
Show resolved Hide resolved
The `output_dir` can be specified as `~` for the home directory or `.` for the current working directory. Here is an example `config.yml`, which assumes that a directory named `~/code` already exists:

Expand All @@ -40,4 +44,8 @@ repo_name: testing-kedro
python_package: test_kedro
```
**Use `kedro new` with a `--starter`** <br />
Alternatively, you can create a new Kedro project with a [starter](./starters.md) that adds a set of code for a common project use case.
You can create a new Kedro project with a [starter](./starters.md) that adds a set of code for a common project use case.

SajidAlamQB marked this conversation as resolved.
Show resolved Hide resolved
``` {important}
You can not combine the use of a Kedro starter with the tools and example code options listed above.
```
227 changes: 224 additions & 3 deletions docs/source/starters/new_project_tools.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,225 @@
# Configure a new project
# Tools to customise a new Kedro project

AhdraMeraliQB marked this conversation as resolved.
Show resolved Hide resolved
<!--TO DO-->
<!--Detailed usage of add-ons goes here-->
There are several ways to customise your new project with the tools and example code.

## `kedro new`

Navigate to the directory in which you would like to create your new Kedro project, and run the following command:

```bash
kedro new
```

This will start the new project creation workflow.

``` {note}
You can also add flags to `kedro new` to skip some or all of the steps in the project creation workflow to skip queries about how you want to customise the project. The flags are described below.
```

### Project name
The first prompt asks you to input a project name.

You can skip the step to name the project by adding it to your command. For example:

```bash
kedro new --name=spaceflights
```

### Tools
You are then asked to select which tools to include. Choose from the list using comma separated values `(1,2,4)`, ranges of values `(1-3,5-7)`, a combination of the two `(1,3-5,7)`, or the key words `all` or `none`. Skipping the prompt by entering no value will result in the default selection of `none`. Further information about each of the tools is described below in [Kedro tools](#kedro-tools).


| ![](../meta/images/kedro-new-tools-prompt.png)|
|:--:|
| *Prompt for tools selection* |


You may also specify your tools selection directly from the command line by using the flag `--tools`:

```bash
kedro new --tools=<your tool selection>
```

To specify your desired tools you must provide them by name as a comma separated list, for example `--tools=lint,test,viz`. The following tools are available for selection: `lint`, `test`, `log`, `docs`, `data`, `pyspark`, and `viz`.

A list of available tools can also be accessed by running `kedro new --help`

![](../meta/images/kedro-new-help.png)

AhdraMeraliQB marked this conversation as resolved.
Show resolved Hide resolved

### Example code
In the final step you are asked whether you want to populate the project with an example pipeline. Further information about this pipeline is below in [Example pipeline](#example-pipeline).

You can add the example pipeline to your new project as follows:

```bash
kedro new --example=y
```

## `kedro new --config=`

As an alternative to the interactive project creation workflow, you can also supply values to `kedro new` by providing a YML configuration file to your `kedro new` command. Consider the following file:

```yaml
# config.yml

"project_name":
"My Project"

"repo_name":
"my-project"

"python_package":
"my project"

"tools":
"2-6"
```

To create a new project using the file to supply details to `kedro new`, run the following command:

```bash
kedro new --config=<path/to/config.yml>
```

``` {note}
Note: When using a configuration file to create a new project, you must provide values for the project name, repository name, and package names.
```

Specifying your tools selection is optional, omitting them results in the default selection of `none`.

## Kedro tools

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The section heading and introduction could use some help, CC @amandakys

Tools in Kedro serve as modular functionalities that enhance a foundational project template. They provide a means to tailor your Kedro project to meet your unique requirements. When creating a new project, you may select one or more of the available tools, or none at all.

The available tools include: linting, testing, custom logging, documentation, data structure, PySpark, and Kedro-Viz.

### Linting

The Kedro linting tool introduces [`black`](https://black.readthedocs.io/en/stable/index.html) and [`ruff`](https://docs.astral.sh/ruff/) as dependencies in your new project's requirements. After project creation, make sure these are installed by running the following command from the project root:

```bash
pip install -r requirements.txt
```

The linting tool will configure `ruff` with the following settings by default:
```toml
#pyproject.toml

[tool.ruff]
line-length = 88
show-fixes = true
select = [
"F", # Pyflakes
"W", # pycodestyle
"E", # pycodestyle
"I", # isort
"UP", # pyupgrade
"PL", # Pylint
"T201", # Print Statement
]
ignore = ["E501"] # Black takes care of line-too-long
```

With these installed, you can then make use of the following commands to format and lint your code:

```bash
ruff format path/to/project/root
black path/to/project/root --check
```

Though it has no impact on how your code works, linting is important for code quality because improves consistency, readability, debugging, and maintainability. To learn more about linting your Kedro projects, check our [linting documentation](../development/linting.md).

### Testing

This tool introduces the `tests` directory to the new project's structure, containing the file `test_run.py` with an example unit test. [`Pytest`](https://docs.pytest.org/en/7.4.x/) is added as a dependency in your new project's requirements. After project creation, make sure it is installed by running the following command from your project root:

```bash
pip install -r requirements.txt
```

The tool leverages `pytest` with the following configuration:

```toml
[tool.pytest.ini_options]
addopts = """
--cov-report term-missing \
--cov src/{{ cookiecutter.python_package }} -ra"""

[tool.coverage.report]
fail_under = 0
show_missing = true
exclude_lines = ["pragma: no cover", "raise NotImplementedError"]
```

To run your tests, use the following command:
```bash
pytest path/to/your/project/root/tests
```

Kedro promotes the use of unit tests to achieve high code quality and maintainability in your projects. To read more about unit testing with Kedro, check our [testing documentation](../development/automated_testing.md#set-up-automated-testing-with-pytest)

### Custom logging

Selecting the custom logging tool introduces the file `logging.yml` to your project's `conf` directory. This tool allows you to customise your logging configuration instead of using [Kedro's default logging configuration](https://github.com/kedro-org/kedro/blob/main/kedro/framework/project/default_logging.yml). The populated `conf/logging.yml` provides two additional logging handlers: `console` and `info_file_handler`, as well as `rich` that is available in the default configuration, though only `info_file_handler` and `rich` are used.

To use this provided logging configuration, remember to set the `KEDRO_LOGGING_CONFIG` environment variable to point to `logging.yml` by naviagting to your project root and running the following command:

```bash
export KEDRO_LOGGING_CONFIG=conf/logging.yml
```

To learn more about using logging in your project, or modifying the logging configuration, take a look at our [logging documentation](../logging/index.md).

astrojuanlu marked this conversation as resolved.
Show resolved Hide resolved
### Documentation

AhdraMeraliQB marked this conversation as resolved.
Show resolved Hide resolved
Including the Documentation tool adds a `docs` directory to your project structure and includes the Sphinx setup files, `conf.py` and `index.rst`, with some added features such as auto generation of HTML documentation.
The aim of this tool reflects Kedro's commitment to best practices in understanding code and facilitating collaboration by helping you create and maintain guides and API docs.

If you did not initially select `docs` and want to implement it later you can do so by following the [official documentation](https://docs.kedro.org/en/stable/tutorial/package_a_project.html#add-documentation-to-a-kedro-project) for guidance on adding documentation to a Kedro project.

SajidAlamQB marked this conversation as resolved.
Show resolved Hide resolved
### Data Structure

The Data Structure tool provides a local standardised folder hierarchy for your project data, which includes predefined folders such as raw, intermediate, and processed data, as determined by [data engineering convention](https://docs.kedro.org/en/stable/faq/faq.html#what-is-data-engineering-convention).
This is crucial if you want to include example pipelines during the creation of your project as it can not be omitted from the tool selections.
Kedro's capabilities extend far beyond local data storage. Kedro seamlessly integrates with Data Lakes and various databases through fsspec URIs, catering to the needs of professional teams that store their data in blob/object storage or databases.
We believe a well-organised data structure is key to efficient data management, allowing for scalable and maintainable data pipelines.
You can learn more about Kedro's recommended [project directory structure](https://docs.kedro.org/en/stable/get_started/kedro_concepts.html#kedro-project-directory-structure).

### PySpark

The `PySpark` tool modifies the project's `requirements.txt` to include PySpark dependencies and adjusts the project setup for Spark jobs, this will allow you to process datasets using Apache Spark for scalable data processing.
PySpark aligns with Kedro's scalability principle, as it provides data processing capabilities for large datasets.
See the [PySpark integration documentation](https://docs.kedro.org/en/stable/integrations/pyspark_integration.html) for more information on setup and usage.

### Kedro Viz

The `viz` tool will add visualisation to your project by including Kedro-Viz, which creates an interactive web-app to visualise your pipelines allowing for an intuitive understanding of data on your DAG.
In addition, `viz` will also add setup for experiment tracking and plotting datasets.
See the [Kedro-Viz documentation](https://docs.kedro.org/projects/kedro-viz/en/stable/index.html) for more information on using this tool.

## Flowchart of example choice of tools and example selections

Here is a flowchart to help illustrate some example choice of tools you can select:

```{mermaid}
:alt: Example diagram of specific tool choices
flowchart TD
A[Start] --> B[Enter Project Name: Example Project];
B --> C3[Select Tools: None];
B --> C1[Select Tools: lint, docs, PySpark];
B --> C2[Select Tools: All];

C1 --> D1[Include Example Pipeline?];
C2 --> D2[Include Example Pipeline?];
C3 --> D3[Include Example Pipeline?];

D1 -->|Yes| E1[New Project Created\nName: Example Project\nTools: lint, docs, PySpark\nExample: Yes];
D1 -->|No| E2[New Project Created\nName: Example Project\nTools: lint, docs, PySpark\nExample: No];

D2 -->|Yes| F1[New Project Created\nName: Example Project\nTools: All: lint, test, logging, docs, data, PySpark, viz \nExample: Yes];
D2 -->|No| F2[New Project Created\nName: Example Project\nTools: All: lint, test, logging, docs, data, PySpark, viz \nExample: No];

D3 -->|Yes| G1[New Project Created\nName: Example Project\nTools: None\nExample: Yes];
D3 -->|No| G2[New Project Created\nName: Example Project\nTools: None\nExample: No];
```
5 changes: 3 additions & 2 deletions docs/source/starters/starters.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

A Kedro starter contains code in the form of a [Cookiecutter](https://cookiecutter.readthedocs.io/) template for a Kedro project. Using a starter is like using a pre-defined layout when creating a presentation or document.

You can create your own starters for reuse within a project or team, as described in the [how to create a Kedro starter](../starters/create_a_starter.md) documentation.

## How to use a starter

To create a Kedro project using a starter, apply the `--starter` flag to `kedro new`. For example:
Expand Down Expand Up @@ -80,3 +78,6 @@ kedro new --config=my_kedro_project.yml --starter=spaceflights-pandas
```

This option is useful when the starter requires more configuration than the default mode requires.

## Create a starter
You can build your own starters for reuse within a project or team, as described in the [how to create a Kedro starter](../starters/create_a_starter.md) documentation.
6 changes: 5 additions & 1 deletion docs/source/tutorial/package_a_project.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ This section explains how to build project documentation, and how to bundle a Ke

Kedro also has an advanced feature which supports packaging on a pipeline level allowing you share and reuse pipelines across projects! To read more about this please look at the [section on micro-packaging](../nodes_and_pipelines/micro_packaging.md).

## Add documentation to a Kedro project
## Add documentation to a Kedro project if you have not selected `docs` tool

```{note}
These steps are for projects without the `docs` tool option. You can verify this by looking to see if you don't have a `docs` directory in your project.
```

There are several documentation frameworks for Python projects. This section describes how to use [Sphinx](https://www.sphinx-doc.org).

Expand Down
14 changes: 7 additions & 7 deletions kedro/framework/cli/starters.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
3) Custom Logging: Provides more logging options\n
4) Documentation: Basic documentation setup with Sphinx\n
5) Data Structure: Provides a directory structure for storing data\n
6) Pyspark: Provides set up configuration for working with PySpark\n
6) PySpark: Provides set up configuration for working with PySpark\n
7) Kedro Viz: Provides Kedro's native visualisation tool \n

Example usage:\n
Expand Down Expand Up @@ -125,7 +125,7 @@ class KedroStarterSpec: # noqa: too-few-public-methods
"3": "Custom Logging",
"4": "Documentation",
"5": "Data Structure",
"6": "Pyspark",
"6": "PySpark",
"7": "Kedro Viz",
}

Expand Down Expand Up @@ -633,11 +633,11 @@ def fetch_template_based_on_tools(template_path, cookiecutter_args: dict[str, An
tools = extra_context.get("tools", [])
example_pipeline = extra_context.get("example_pipeline", False)
starter_path = "git+https://github.com/kedro-org/kedro-starters.git"
if "Pyspark" in tools and "Kedro Viz" in tools:
# Use the spaceflights-pyspark-viz starter if both Pyspark and Kedro Viz are chosen.
if "PySpark" in tools and "Kedro Viz" in tools:
# Use the spaceflights-pyspark-viz starter if both PySpark and Kedro Viz are chosen.
cookiecutter_args["directory"] = "spaceflights-pyspark-viz"
elif "Pyspark" in tools:
# Use the spaceflights-pyspark starter if only Pyspark is chosen.
elif "PySpark" in tools:
# Use the spaceflights-pyspark starter if only PySpark is chosen.
cookiecutter_args["directory"] = "spaceflights-pyspark"
elif "Kedro Viz" in tools:
# Use the spaceflights-pandas-viz starter if only Kedro Viz is chosen.
Expand All @@ -646,7 +646,7 @@ def fetch_template_based_on_tools(template_path, cookiecutter_args: dict[str, An
# Use spaceflights-pandas starter if example was selected, but PySpark or Viz wasn't
cookiecutter_args["directory"] = "spaceflights-pandas"
else:
# Use the default template path for non Pyspark, Viz or example options:
# Use the default template path for non PySpark, Viz or example options:
starter_path = template_path
return starter_path

Expand Down
2 changes: 1 addition & 1 deletion kedro/templates/project/hooks/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def setup_template_tools(selected_tools_list: str, requirements_file_path: str,
if "Data Structure" not in selected_tools_list and example_pipeline != "True":
_remove_dir(current_dir / "data")

if ("Pyspark" in selected_tools_list or "Kedro Viz" in selected_tools_list) and example_pipeline != "True":
if ("PySpark" in selected_tools_list or "Kedro Viz" in selected_tools_list) and example_pipeline != "True":
_remove_pyspark_viz_starter_files("Kedro Viz" in selected_tools_list, python_package_name)


Expand Down
Loading
Loading