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

Version prediction fails with assertion error when invoked from within wheel package in Spark job #7

Open
mlangc opened this issue Nov 10, 2020 · 1 comment

Comments

@mlangc
Copy link

mlangc commented Nov 10, 2020

Calling version_query.predict_version_str() from within a wheel package that was submitted with a Spark job causes the following error:

Traceback (most recent call last):
  File "/project/root/run/run.py", line 4, in <module>
    print(f"Running version {some_module.get_version()}")
  File "/project/root/dist/package-0.1.0.dev1+bfcaa08b-py3-none-any.whl/some_module.py", line 5, in get_version
  File "/project/root/venv/lib/python3.7/site-packages/version_query/query.py", line 96, in predict_version_str
    return predict_caller(2).to_str()
  File "/project/root/venv/lib/python3.7/site-packages/version_query/query.py", line 81, in predict_caller
    here = _caller_folder(stack_level + 1)
  File "/project/root/venv/lib/python3.7/site-packages/version_query/query.py", line 22, in _caller_folder
    assert here.is_file(), here
AssertionError: /project/root/dist/package-0.1.0.dev1+bfcaa08b-py3-none-any.whl/some_module.py

I've created a minimal example to reproduce this bug: https://github.com/mlangc/reproduce-spark-related-version-query-issue

@mlangc
Copy link
Author

mlangc commented Nov 15, 2020

@mbdevpl I'd be happy to work on this myself, if there is a reasonable change that you are going to review, and merge a PR related to this issue. Any feedback from your side would be highly appreciated. Thanks!

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

1 participant