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

[Docs] Show source links to 404 page #39291

Closed
AlenkaF opened this issue Dec 19, 2023 · 6 comments · Fixed by #40167
Closed

[Docs] Show source links to 404 page #39291

AlenkaF opened this issue Dec 19, 2023 · 6 comments · Fixed by #40167

Comments

@AlenkaF
Copy link
Member

AlenkaF commented Dec 19, 2023

Describe the bug, including details regarding any error messages, version, and platform.

In the Arrow documentation one could use the "Show source" link to check the source of the documentation or even more important the source code in the API docs. This doesn't work currently as it links to a 404 No found page.

https://arrow.apache.org/docs/dev/cpp/api/datatype.html --> https://arrow.apache.org/docs/dev/_sources/cpp/api/datatype.rst.txt

Component(s)

Documentation

@bkietz
Copy link
Member

bkietz commented Feb 7, 2024

In a local build of documentation the link works, so the issue must be in what files are bundled for hosting

@jorisvandenbossche
Copy link
Member

We should probably just see if we can remove that "show source" button. It's not that useful in this case, because it's not meant to show the actual source code, but the "source" of the page, i.e. the raw restructuredtext representation of that page.

To have a link to the actual source code, the "Edit on github" essentially does (or tries) that

@bkietz
Copy link
Member

bkietz commented Feb 8, 2024

Well if that's all we need then it's supported with an option https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/source-buttons.html#view-source-link

@Divyansh200102
Copy link
Contributor

Divyansh200102 commented Feb 18, 2024

does it work if we make this change? @bkietz @jorisvandenbossche

diff --git a/docs/source/conf.py b/docs/source/conf.py
index 89a0ba088..b483ff23d 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -401,7 +401,7 @@ html_baseurl = "https://arrow.apache.org/docs/"
 
 # If true, links to the reST sources are added to the pages.
 #
-# html_show_sourcelink = True
+html_show_sourcelink = True
 
 # If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
 #

also if you don't mind I was trying to build conf.py using python doctest but this error is coming could you please take a look at the log?

Divyansh@LAPTOP-8JH824JM MINGW64 ~/Documents/GitHub
$ pushd arrow/python
~/Documents/GitHub/arrow/python ~/Documents/GitHub

Divyansh@LAPTOP-8JH824JM MINGW64 ~/Documents/GitHub/arrow/python (main)
$ python -m venv myenv

Divyansh@LAPTOP-8JH824JM MINGW64 ~/Documents/GitHub/arrow/python (main)
$ source myenv/Scripts/activate
(myenv) 
Divyansh@LAPTOP-8JH824JM MINGW64 ~/Documents/GitHub/arrow/python (main)
$ pip install pytest-cython
Collecting pytest-cython
  Obtaining dependency information for pytest-cython from https://files.pythonhosted.org/packages/20/e6/dd6f6fae2e4e15f2abc5d95da945d5044bb2a4488edc8bd9c8c6a8645376/pytest_cython-0.2.1-py2.py3-none-any.whl.metadata
  Using cached pytest_cython-0.2.1-py2.py3-none-any.whl.metadata (3.4 kB)
Collecting pytest>=4.6.0 (from pytest-cython)
  Obtaining dependency information for pytest>=4.6.0 from https://files.pythonhosted.org/packages/2e/28/30125a808a2448d72fdba26d01ef2bec76a3c860c8694b636e6104e38713/pytest-8.0.1-py3-none-any.whl.metadata
  Using cached pytest-8.0.1-py3-none-any.whl.metadata (7.7 kB)
Collecting iniconfig (from pytest>=4.6.0->pytest-cython)
  Using cached iniconfig-2.0.0-py3-none-any.whl (5.9 kB)
Collecting packaging (from pytest>=4.6.0->pytest-cython)
  Obtaining dependency information for packaging from https://files.pythonhosted.org/packages/ec/1a/610693ac4ee14fcdf2d9bf3c493370e4f2ef7ae2e19217d7a237ff42367d/packaging-23.2-py3-none-any.whl.metadata
  Using cached packaging-23.2-py3-none-any.whl.metadata (3.2 kB)
Collecting pluggy<2.0,>=1.3.0 (from pytest>=4.6.0->pytest-cython)
  Obtaining dependency information for pluggy<2.0,>=1.3.0 from https://files.pythonhosted.org/packages/a5/5b/0cc789b59e8cc1bf288b38111d002d8c5917123194d45b29dcdac64723cc/pluggy-1.4.0-py3-none-any.whl.metadata
  Using cached pluggy-1.4.0-py3-none-any.whl.metadata (4.3 kB)
Collecting colorama (from pytest>=4.6.0->pytest-cython)
  Using cached colorama-0.4.6-py2.py3-none-any.whl (25 kB)
Using cached pytest_cython-0.2.1-py2.py3-none-any.whl (6.4 kB)
Using cached pytest-8.0.1-py3-none-any.whl (333 kB)
Using cached pluggy-1.4.0-py3-none-any.whl (20 kB)
Using cached packaging-23.2-py3-none-any.whl (53 kB)
Installing collected packages: pluggy, packaging, iniconfig, colorama, pytest, pytest-cython
Successfully installed colorama-0.4.6 iniconfig-2.0.0 packaging-23.2 pluggy-1.4.0 pytest-8.0.1 pytest-cython-0.2.1

[notice] A new release of pip is available: 23.2.1 -> 24.0
[notice] To update, run: python.exe -m pip install --upgrade pip
(myenv) 
Divyansh@LAPTOP-8JH824JM MINGW64 ~/Documents/GitHub/arrow/python (main)
$ pytest --doctest-cython
C:\Users\Divyansh\Documents\GitHub\arrow\python\myenv\Lib\site-packages\pytest_cython\__init__.py:7: UserWarning: could not get pytest-cython version; pkg_resources not available or package not installed
  warnings.warn('could not get pytest-cython version; pkg_resources '
=============================================================================== test session starts ===============================================================================
platform win32 -- Python 3.12.0, pytest-8.0.1, pluggy-1.4.0
rootdir: C:\Users\Divyansh\Documents\GitHub\arrow\python
configfile: setup.cfg
plugins: cython-0.2.1
collected 0 items / 2 errors                                                                                                                                                       

===================================================================================== ERRORS ====================================================================================== 
____________________________________________________________________________ ERROR collecting pyarrow _____________________________________________________________________________ 
C:\Python312\Lib\importlib\__init__.py:90: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1381: in _gcd_import
    ???
<frozen importlib._bootstrap>:1354: in _find_and_load
    ???
<frozen importlib._bootstrap>:1304: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:488: in _call_with_frames_removed
    ???
<frozen importlib._bootstrap>:1381: in _gcd_import
    ???
<frozen importlib._bootstrap>:1354: in _find_and_load
    ???
<frozen importlib._bootstrap>:1325: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:929: in _load_unlocked
    ???
<frozen importlib._bootstrap_external>:994: in exec_module
    ???
<frozen importlib._bootstrap>:488: in _call_with_frames_removed
    ???
pyarrow\__init__.py:65: in <module>
    import pyarrow.lib as _lib
E   ModuleNotFoundError: No module named 'pyarrow.lib'
_________________________________________________ ERROR collecting pythonenv/Lib/site-packages/numpy/testing/tests/test_utils.py __________________________________________________ 
ImportError while importing test module 'C:\Users\Divyansh\Documents\GitHub\arrow\python\pythonenv\Lib\site-packages\numpy\testing\tests\test_utils.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
C:\Python312\Lib\importlib\__init__.py:90: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
pythonenv\Lib\site-packages\numpy\testing\__init__.py:11: in <module>
    from ._private.utils import *
pythonenv\Lib\site-packages\numpy\testing\_private\utils.py:21: in <module>
    import numpy as np
E   ModuleNotFoundError: No module named 'numpy'
============================================================================= short test summary info ============================================================================= 
ERROR pyarrow - ModuleNotFoundError: No module named 'pyarrow.lib'
ERROR pythonenv/Lib/site-packages/numpy/testing/tests/test_utils.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
================================================================================ 2 errors in 0.32s ================================================================================ 
(myenv) 
Divyansh@LAPTOP-8JH824JM MINGW64 ~/Documents/GitHub/arrow/python (main)
$ pip install pyarrow
Collecting pyarrow
  Obtaining dependency information for pyarrow from https://files.pythonhosted.org/packages/1a/f7/f6df7992ef2339bbf31ba349de19af5b8fd75590129c4e8fcb719f24fe5f/pyarrow-15.0.0-cp312-cp312-win_amd64.whl.metadata
  Using cached pyarrow-15.0.0-cp312-cp312-win_amd64.whl.metadata (3.1 kB)
Collecting numpy<2,>=1.16.6 (from pyarrow)
  Obtaining dependency information for numpy<2,>=1.16.6 from https://files.pythonhosted.org/packages/16/2e/86f24451c2d530c88daf997cb8d6ac622c1d40d19f5a031ed68a4b73a374/numpy-1.26.4-cp312-cp312-win_amd64.whl.metadata
  Using cached numpy-1.26.4-cp312-cp312-win_amd64.whl.metadata (61 kB)
Using cached pyarrow-15.0.0-cp312-cp312-win_amd64.whl (25.3 MB)
Using cached numpy-1.26.4-cp312-cp312-win_amd64.whl (15.5 MB)
Installing collected packages: numpy, pyarrow
Successfully installed numpy-1.26.4 pyarrow-15.0.0

[notice] A new release of pip is available: 23.2.1 -> 24.0
[notice] To update, run: python.exe -m pip install --upgrade pip
(myenv) 
Divyansh@LAPTOP-8JH824JM MINGW64 ~/Documents/GitHub/arrow/python (main)
$ python -m pytest --doctest-cython
C:\Users\Divyansh\Documents\GitHub\arrow\python\myenv\Lib\site-packages\pytest_cython\__init__.py:7: UserWarning: could not get pytest-cython version; pkg_resources not available or package not installed
  warnings.warn('could not get pytest-cython version; pkg_resources '
=============================================================================== test session starts ===============================================================================
platform win32 -- Python 3.12.0, pytest-8.0.1, pluggy-1.4.0
rootdir: C:\Users\Divyansh\Documents\GitHub\arrow\python
configfile: setup.cfg
plugins: cython-0.2.1
collected 139 items / 1 error                                                                                                                                                      

===================================================================================== ERRORS ====================================================================================== 
____________________________________________________________________________ ERROR collecting pyarrow _____________________________________________________________________________ 
C:\Python312\Lib\importlib\__init__.py:90: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1381: in _gcd_import
    ???
<frozen importlib._bootstrap>:1354: in _find_and_load
    ???
<frozen importlib._bootstrap>:1304: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:488: in _call_with_frames_removed
    ???
<frozen importlib._bootstrap>:1381: in _gcd_import
    ???
<frozen importlib._bootstrap>:1354: in _find_and_load
    ???
<frozen importlib._bootstrap>:1325: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:929: in _load_unlocked
    ???
<frozen importlib._bootstrap_external>:994: in exec_module
    ???
<frozen importlib._bootstrap>:488: in _call_with_frames_removed
    ???
pyarrow\__init__.py:65: in <module>
    import pyarrow.lib as _lib
E   ModuleNotFoundError: No module named 'pyarrow.lib'
================================================================================ warnings summary ================================================================================= 
pythonenv\Lib\site-packages\numpy\testing\tests\test_utils.py:1585
  C:\Users\Divyansh\Documents\GitHub\arrow\python\pythonenv\Lib\site-packages\numpy\testing\tests\test_utils.py:1585: PytestUnknownMarkWarning: Unknown pytest.mark.slow - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html
    @pytest.mark.slow

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
============================================================================= short test summary info ============================================================================= 
ERROR pyarrow - ModuleNotFoundError: No module named 'pyarrow.lib'
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
=========================================================================== 1 warning, 1 error in 0.53s =========================================================================== 

@jorisvandenbossche
Copy link
Member

does it work if we make this change?

We would need to set the value to False instead of True

also if you don't mind I was trying to build conf.py using python doctest but this error is coming could you please take a look at the log?

Running those requires you to have a development install of pyarrow (see https://arrow.apache.org/docs/dev/developers/python.html for more details)

@Divyansh200102
Copy link
Contributor

Take

jorisvandenbossche pushed a commit that referenced this issue Feb 21, 2024
### Rationale for this change
To fix the show source button links to 404 page problem

### What changes are included in this PR?
The show source button link will be removed.

### Are these changes tested?
Not yet

### Are there any user-facing changes?
Yes

* Closes: #39291
* GitHub Issue: #39291

Authored-by: Divyansh200102 <divyanshkhatri200102@gmail.com>
Signed-off-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
@jorisvandenbossche jorisvandenbossche added this to the 16.0.0 milestone Feb 21, 2024
zanmato1984 pushed a commit to zanmato1984/arrow that referenced this issue Feb 28, 2024
…pache#40167)

### Rationale for this change
To fix the show source button links to 404 page problem

### What changes are included in this PR?
The show source button link will be removed.

### Are these changes tested?
Not yet

### Are there any user-facing changes?
Yes

* Closes: apache#39291
* GitHub Issue: apache#39291

Authored-by: Divyansh200102 <divyanshkhatri200102@gmail.com>
Signed-off-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
thisisnic pushed a commit to thisisnic/arrow that referenced this issue Mar 8, 2024
…pache#40167)

### Rationale for this change
To fix the show source button links to 404 page problem

### What changes are included in this PR?
The show source button link will be removed.

### Are these changes tested?
Not yet

### Are there any user-facing changes?
Yes

* Closes: apache#39291
* GitHub Issue: apache#39291

Authored-by: Divyansh200102 <divyanshkhatri200102@gmail.com>
Signed-off-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants