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

Unknown documents in resources.py if you use a intersphinx setup #1750

Open
ulliholtgrave opened this issue Jan 31, 2024 · 0 comments
Open
Labels

Comments

@ulliholtgrave
Copy link
Contributor

ulliholtgrave commented Jan 31, 2024

Describe the bug
Although I managed to understand and solve the intersphinx problems with the indentation of the docstrings (see #1743 ). I still can't get the reason why we get linking warnings for the following 3 docstrings if we import the library:

docstring of import_export.resources.Resource.get_instance:1: WARNING: unknown document: 'api_instance_loaders'
docstring of import_export.resources.Resource.import_data:1: WARNING: unknown document: 'import_workflow'
docstring of import_export.resources.Resource.import_row:1: WARNING: unknown document: 'import_workflow'

I have not found a solution at the moment, so I am opening an issue for it. Perhaps someone else is more familiar with the correct Intersphinx syntax for this. In the additional context, I have also described a workaround for overwriting the affected functions so that the warning no longer occurs.

To Reproduce
Steps to reproduce the behavior:

  1. Set up another Python project
  2. Import a django-import-export to one of your files
  3. Set up your documentation with Intersphinx to extend your documentation with additional information from other Sphinx documentation
  4. The warnings described above appear

Versions

  • Django Import Export: [3.3.6]
  • Python [3.11]
  • Django [3.4]

Expected behavior
Sphinx should be able to read the docstrings from the documentation

Additional context
As a workaround to avoid these warnings, the affected functions and modules can be overwritten locally and the docstrings adapted accordingly. Sphinx then uses the local docstrings and does not retrieve any further information via Intersphinx. Example:

    def get_instance(self, instance_loader, row):
        """
        If all 'import_id_fields' are present in the dataset, calls
        the InstanceLoader. Otherwise, returns `None`.
        """
        return super().get_instance(instance_loader, row)

However, this feels like a very dirty workaround and I hope we can solve this upstream.

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

No branches or pull requests

1 participant