Skip to content

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

@mlangc

Description

@mlangc

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions