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

Error when running tests in spaceflights_pandas starter #252

Closed
michal-mmm opened this issue Nov 7, 2024 · 4 comments
Closed

Error when running tests in spaceflights_pandas starter #252

michal-mmm opened this issue Nov 7, 2024 · 4 comments

Comments

@michal-mmm
Copy link
Contributor

Description

When running pytest for the starter spaceflights_pandas the error occurs.

Exact place of the error:

Code for the instantiated object:
https://github.com/kedro-org/kedro/blob/91468e64ea6f1fc4d51fe6313d738476189dd74a/kedro/framework/context/context.py#L148

Context

I was trying to run tests.

Steps to Reproduce

  1. kedro new --starter=spaceflights-pandas
  2. setting up venv (I did that using uv)
  3. pytest

Expected Result

Passing tests

Actual Result

Tell us what happens instead.

================================= short test summary info ==================================
ERROR tests/test_run.py::TestProjectContext::test_project_path - TypeError: KedroContext.__init__() missing 1 required positional argument: 'env'

Your Environment

Include as many relevant details about the environment in which you experienced the bug:
Relevant elements of pyproject.toml:

[project]
name = "spaceflights-pandas"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.10"
dependencies = [
    "kedro-datasets[pandas-csvdataset,pandas-exceldataset,pandas-parquetdataset]==5.1.0",
    "kedro==0.19.9",
    "pandas>=2.2.3",
    "scikit-learn>=1.5.2",
]

[tool.kedro]
package_name = "spaceflights_pandas"
project_name = "Spaceflights Pandas"
kedro_init_version = "0.19.9"
tools = ['None']
example_pipeline = "False"
source_dir = "src"

[dependency-groups]
dev = [
    "kedro-viz>=10.0.0",
    "pytest>=8.3.3",
]

[tool.pytest.ini_options]
pythonpath = "src"
testpaths = "tests"
  • Kedro version used (pip show kedro or kedro -V): 0.19.9
  • Python version used (python -V): 3.10.15
  • Operating system and version: macOS 15.1
@DimedS
Copy link
Member

DimedS commented Nov 7, 2024

Thanks for reporting that bug, @michal-mmm! It looks like we need to add env="local" to all our starters, as we've done in our template:
https://github.com/kedro-org/kedro/blob/c618000dd3af9133bdf80c3e5dec6492ee3c44fa/kedro/templates/project/%7B%7B%20cookiecutter.repo_name%20%7D%7D/tests/test_run.py#L31

Would you be interested in raising a PR to fix this?

@merelcht
Copy link
Member

merelcht commented Nov 7, 2024

Looks like this is a duplicate of #221

@michal-mmm
Copy link
Contributor Author

michal-mmm commented Nov 7, 2024

Would you be interested in raising a PR to fix this?

Yep, I can do that later today

Looks like this is a duplicate of #221

Sorry, forgot to look through existing issues

@DimedS
Copy link
Member

DimedS commented Nov 8, 2024

Fixed by #254

@DimedS DimedS closed this as completed Nov 8, 2024
@github-project-automation github-project-automation bot moved this from In Progress to Done in Kedro Wizard 🪄 Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

3 participants