Skip to content

Error loading temp directory documents after Git clone for knowledge  #885

@aartij22

Description

@aartij22

I tried generating dataset for knowledge using the below document values in my qna.yaml -

document:
  repo: https://github.com/aartij22/doc_test.git
  commit: 543dd61
  patterns:
    - 'docs/*.md'

Running ilab diff gives the following error -

knowledge/test/qna.yaml
Traceback (most recent call last):
  File "/Users/aajha/Desktop/cli/cli/utils.py", line 485, in read_taxonomy_file
    documents = get_documents(source=documents, logger=logger)
  File "/Users/aajha/Desktop/cli/cli/utils.py", line 226, in get_documents
    for file_path in glob.glob(os.path.join(working_dir, pattern)):
  File "/Users/aajha/.pyenv/versions/3.9.6/lib/python3.9/posixpath.py", line 76, in join
    a = os.fspath(a)
TypeError: expected str, bytes or os.PathLike object, not Repo

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/aajha/Desktop/cli/venv/bin/ilab", line 8, in <module>
    sys.exit(cli())
  File "/Users/aajha/Desktop/cli/venv/lib/python3.9/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/Users/aajha/Desktop/cli/venv/lib/python3.9/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/Users/aajha/Desktop/cli/venv/lib/python3.9/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/aajha/Desktop/cli/venv/lib/python3.9/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/aajha/Desktop/cli/venv/lib/python3.9/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/Users/aajha/Desktop/cli/venv/lib/python3.9/site-packages/click/decorators.py", line 33, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/Users/aajha/Desktop/cli/cli/lab.py", line 254, in diff
    read_taxonomy(logger, taxonomy_path, taxonomy_base, yaml_rules)
  File "/Users/aajha/Desktop/cli/cli/utils.py", line 533, in read_taxonomy
    data, warnings, errors = read_taxonomy_file(logger, file_path, yaml_rules)
  File "/Users/aajha/Desktop/cli/cli/utils.py", line 504, in read_taxonomy_file
    raise TaxonomyReadingException(f"Exception {e} raised in {file_path}") from e
cli.utils.TaxonomyReadingException: Exception expected str, bytes or os.PathLike object, not Repo raised in /Users/aajha/Desktop/cli/taxonomy/knowledge/test/qna.yaml

Setting the working_dir to repo in absence of skip_checkout converts the data type from str to git.repo.base.Repo

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions