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

Circular dependencies for pyspark starter #38

Closed
dieutth opened this issue Jun 11, 2021 · 1 comment
Closed

Circular dependencies for pyspark starter #38

dieutth opened this issue Jun 11, 2021 · 1 comment

Comments

@dieutth
Copy link

dieutth commented Jun 11, 2021

Hello, all kedro command return following error when run any kedro command inside a project created from kedro new --starter=pyspark-iris (haven't checked pyspark but I assumed same issue) inside a fresh virtualenv that has kedro installed (beside pip)

(mm-venv) bash-4.2$ kedro install
Traceback (most recent call last):
File "/you/shall/not/path/ds-workspace/mm-venv/bin/kedro", line 8, in <module>
sys.exit(main())
File "/you/shall/not/path/ds-workspace/mm-venv/lib/python3.7/site-packages/kedro/framework/cli/cli.py", line 268, in main
cli_collection = KedroCLI(project_path=Path.cwd())
File "/you/shall/not/path/ds-workspace/mm-venv/lib/python3.7/site-packages/kedro/framework/cli/cli.py", line 181, in __init__
self._metadata = bootstrap_project(project_path)
File "/you/shall/not/path/ds-workspace/mm-venv/lib/python3.7/site-packages/kedro/framework/startup.py", line 181, in bootstrap_project
configure_project(metadata.package_name)
File "/you/shall/not/path/ds-workspace/mm-venv/lib/python3.7/site-packages/kedro/framework/project/__init__.py", line 218, in configure_project
_validate_module(settings_module)
File "/you/shall/not/path/ds-workspace/mm-venv/lib/python3.7/site-packages/kedro/framework/project/__init__.py", line 210, in _validate_module
importlib.import_module(settings_module)
File "/usr/local/opt/python@3.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/private/tmp/new-kedro-project/src/new_kedro_project/settings.py", line 30, in <module>
from new_kedro_project.context import ProjectContext
File "/private/tmp/new-kedro-project/src/new_kedro_project/context.py", line 34, in <module>
from pyspark import SparkConf

As the stack trace shows, reason is because kedro tries to validate the project before kedro install got a chance to run, and all kedro command failed because project context try to import some not-yet-installed packages.

There are some not-beautiful workaround but wonder if this is indeed the issue or i misunderstood anything?

@ignacioparicio
Copy link
Contributor

Linked to 767 on the main Kedro repo, now fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants