GayathriSrividya opened a new pull request, #623:
URL: https://github.com/apache/hudi-rs/pull/623

   ## Summary
   
   Closes #82.
   
   Sets up Python doctest infrastructure and adds runnable `Examples:` blocks 
to the public Python API.
   
   ## Changes
   
   ### `python/pyproject.toml`
   
   Add `addopts = "--doctest-modules"` to `[tool.pytest.ini_options]`. The 
`hudi/` directory was already in `testpaths`; this flag activates doctest 
discovery so the examples in docstrings are collected and run as part of 
`pytest`.
   
   ### `python/hudi/table/builder.py`
   
   Add `Examples:` blocks to every public `HudiTableBuilder` method:
   
   | Method | What the doctest covers |
   |--------|------------------------|
   | `from_base_uri` | Creates a builder; asserts `base_uri`, empty 
`hudi_options`, empty `storage_options` |
   | `with_hudi_option` | Adds a single Hudi key; asserts `hudi_options` dict |
   | `with_hudi_options` | Adds multiple Hudi keys at once; uses `sorted()` for 
determinism |
   | `with_storage_option` | Adds a single storage key; asserts 
`storage_options` dict |
   | `with_storage_options` | Adds multiple storage keys at once |
   | `with_option` | Adds a generic key to `options` |
   | `with_options` | Adds multiple generic keys |
   | `build` | Shows the full builder chain; uses `# doctest: +SKIP` since a 
real table path is required |
   
   ### `python/hudi/_config.py`
   
   Add `Examples:` blocks to the three config enums, demonstrating how to read 
the canonical key string from an enum member:
   
   ```python
   >>> from hudi import HudiTableConfig
   >>> HudiTableConfig.BASE_PATH.value
   'hoodie.base.path'
   ```
   
   Key values were verified against the Rust `AsRef<str>` implementations in 
`crates/core/src/config/{table,read,plan}.rs`.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to