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

Python docstrings on the root module are insufficient #1614

Open
rtyler opened this issue Sep 3, 2023 · 12 comments
Open

Python docstrings on the root module are insufficient #1614

rtyler opened this issue Sep 3, 2023 · 12 comments
Labels
binding/python Issues for the Python package documentation Improvements or additions to documentation enhancement New feature or request good first issue Good for newcomers

Comments

@rtyler
Copy link
Member

rtyler commented Sep 3, 2023

Environment

Delta-rs version: 0.10.1

Binding: python

Environment: Linux/amd64

  • Cloud provider:
  • OS:
  • Other:

Bug

What happened:

>>> help(deltalake)
Help on package deltalake:

NAME
    deltalake

PACKAGE CONTENTS
    _internal
    data_catalog
    exceptions
    fs
    schema
    table
    writer

FUNCTIONS
    rust_core_version()

DATA
    DataType = typing.Union[ForwardRef('PrimitiveType'), Forwar...orwardRe...

VERSION
    0.10.1

What you expected to happen:

The DeltaTable symbol is missing and I would expect it to show up here in the doc strings

How to reproduce it:

More details:

@rtyler rtyler added the bug Something isn't working label Sep 3, 2023
@rtyler rtyler added the good first issue Good for newcomers label Oct 25, 2023
@ion-elgreco ion-elgreco added documentation Improvements or additions to documentation enhancement New feature or request binding/python Issues for the Python package and removed bug Something isn't working labels Nov 22, 2023
@rchojn
Copy link

rchojn commented Jan 20, 2024

Hi @rtyler can I take this one?

@ion-elgreco
Copy link
Collaborator

ion-elgreco commented Jan 20, 2024

@gardnertechhq go ahead :) Happy to see some improvements on the python docs

@rchojn
Copy link

rchojn commented Jan 21, 2024

cool, any tip where to start? I see that rendering docs in sphinx

 sphinx-build -b html source build

return 32 warnings. Have you thought about sphinx linter, e.g in form of pre-commit hook?

@ion-elgreco
Copy link
Collaborator

@rchojn we don't use sphinx anymore, it's only mkdocs now

@rchojn
Copy link

rchojn commented Jan 21, 2024

Hey @ion-elgreco, if that's the case, should we decommission this part?

@ion-elgreco
Copy link
Collaborator

@rchojn eventually yes, @r3stl355 currently has put some redirects on the old docs

@rchojn
Copy link

rchojn commented Jan 22, 2024

thanks @ion-elgreco ! so I should be able to build mkdocs using this from delta-rs/python folder, right?

@rchojn
Copy link

rchojn commented Jan 22, 2024

I followed contributing guide and my make build-docs fails:

INFO    -  [macros] - Extra variables (config file): ['python_api_url', 'generator', 'social']
INFO    -  [macros] - Extra filters (module): ['pretty']
INFO    -  Cleaning site directory
INFO    -  Building documentation to directory: /home/chojnar1/Desktop/personal/delta-rs/site
ERROR   -  mkdocstrings: With sys.path = ['/home/chojnar1/.pyenv/versions/3.8.10/bin', '/home/chojnar1/.pyenv/versions/3.8.10/lib/python38.zip', '/home/chojnar1/.pyenv/versions/3.8.10/lib/python3.8',
           '/home/chojnar1/.pyenv/versions/3.8.10/lib/python3.8/lib-dynload', '/home/chojnar1/.local/lib/python3.8/site-packages', '/home/chojnar1/.pyenv/versions/3.8.10/lib/python3.8/site-packages',
           '/home/chojnar1/Desktop/personal/delta-rs', '/home/chojnar1/Desktop/personal'], accessing 'deltalake' raises ModuleNotFoundError: No module named 'deltalake'
ERROR   -  Error reading page 'api/catalog.md':
ERROR   -  Could not collect 'deltalake.data_catalog.DataCatalog'

Aborted with a BuildError!
make: *** [Makefile:92: build-docs] Error 1

any tip?

@r3stl355
Copy link
Contributor

You likely need to build delta. Try running make delelop before mkdocs

@rchojn
Copy link

rchojn commented Jan 22, 2024

Not sure about warnings, but make develop successfully passed:

   Compiling deltalake-azure v0.1.0 (/home/chojnar1/Desktop/personal/delta-rs/crates/deltalake-azure)
warning: variant `ManagedIdentity` is never constructed
  --> crates/deltalake-azure/src/config.rs:38:5
   |
30 | enum AzureCredential {
   |      --------------- variant in this enum
...
38 |     ManagedIdentity,
   |     ^^^^^^^^^^^^^^^
   |
   = note: `#[warn(dead_code)]` on by default

warning: variant `Parse` is never constructed
 --> crates/deltalake-azure/src/error.rs:8:5
  |
6 | pub(crate) enum Error {
  |                 ----- variant in this enum
7 |     #[error("failed to parse config: {0}")]
8 |     Parse(String),
  |     ^^^^^
  |
  = note: `Error` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis

warning: variant `Parse` is never constructed
 --> crates/deltalake-gcp/src/error.rs:8:5
  |
6 | pub(crate) enum Error {
  |                 ----- variant in this enum
7 |     #[error("failed to parse config: {0}")]
8 |     Parse(String),
  |     ^^^^^
  |
  = note: `Error` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
  = note: `#[warn(dead_code)]` on by default

warning: `deltalake-azure` (lib) generated 2 warnings
warning: `deltalake-gcp` (lib) generated 1 warning
   Compiling deltalake v0.17.0 (/home/chojnar1/Desktop/personal/delta-rs/crates/deltalake)
   Compiling deltalake-python v0.15.1 (/home/chojnar1/Desktop/personal/delta-rs/python)
    Finished dev [unoptimized + debuginfo] target(s) in 1m 31s
📦 Built wheel for abi3 Python ≥ 3.8 to /tmp/.tmp7AgSFZ/deltalake-0.15.1-cp38-abi3-linux_x86_64.whl
🛠 Installed deltalake-0.15.1

Unfortunately error persist and I cannot build the docs :/

@r3stl355
Copy link
Contributor

Make sure you are running make develop followed by make build-docs in the same virtual environment. Ignore the build warnings for this, all should be good so long as you get Installed deltalake-...

@rchojn
Copy link

rchojn commented Jan 24, 2024

Thanks @r3stl355! Somehow after restarting terminal it starts to work, no updates were made from my side, magic 🪄

@rchojn rchojn removed their assignment Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
binding/python Issues for the Python package documentation Improvements or additions to documentation enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants