Skip to content

Commit

Permalink
Update Docs Dependencies (#411)
Browse files Browse the repository at this point in the history
* update requirements file for docs build to add missing dependencies

* add newlines after show and select method docstrings in tsdf class

* add indentation to newline in params so doc-utils recognizes it as param definiton

* helpful script to get latest dbr environment

it's very difficult to use within tox because of how envs are handled

* move doc requirments to common requirements folder

* update tox.ini for doc build

* remove get_latest_dbr_env.sh
  • Loading branch information
R7L208 authored Oct 1, 2024
1 parent 2c97b42 commit 514aeb6
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/requirements.txt → python/requirements/docs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ sphinx-copybutton
sphinx
sphinx-design
sphinx-panels
furo
furo
8 changes: 5 additions & 3 deletions python/tempo/tsdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ def select(self, *cols: Union[str, List[str]]) -> "TSDF":
pyspark.sql.DataFrame.select() method's equivalent for TSDF objects
:param cols: str or list of strs column names (string). If one of the column names is '*', that
column is expanded to include all columns in the current :class:`TSDF`.
column is expanded to include all columns in the current :class:`TSDF`.
## Examples
.. code-block:: python
Expand All @@ -399,6 +399,7 @@ def select(self, *cols: Union[str, List[str]]) -> "TSDF":
[Row(name='Alice', age=2), Row(name='Bob', age=5)]
"""

# The columns which will be a mandatory requirement while selecting from TSDFs
seq_col_stub = [] if bool(self.sequence_col) is False else [self.sequence_col]
mandatory_cols = [self.ts_col] + self.partitionCols + seq_col_stub
Expand Down Expand Up @@ -581,8 +582,8 @@ def show(
:param n: Number of rows to show. (default: 20)
:param truncate: If set to True, truncate strings longer than 20 chars by default.
If set to a number greater than one, truncates long strings to length truncate
and align cells right.
If set to a number greater than one, truncates long strings to length truncate
and align cells right.
:param vertical: If set to True, print output rows vertically (one line per column value).
## Example to show usage:
Expand All @@ -603,6 +604,7 @@ def show(
# Call show method here
phone_accel_tsdf.show()
"""

# validate k <= n
if k > n:
raise ValueError(f"Parameter k {k} cannot be greater than parameter n {n}")
Expand Down
15 changes: 12 additions & 3 deletions python/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,19 @@ commands =
python setup.py clean bdist_wheel

[testenv:build-docs]
description = build distribution
allowlist_externals = make
description = build documentation
basepython = py3.10
skipdist = true
skip_install = true
allowlist_externals =
make
deps =
-r ../docs/requirements.txt
-rrequirements/docs.txt
; TODO: making this dynamic is difficult in tox, so for now we will just use the latest version
; We should have a top-level makefile that orchestrates this which allows better environment prep and execution of
; shell scripts prior to tox execution. it'll also create a stable interface for migrating to hatch in the future
; since the make commands would not change
-rrequirements/dbr143.txt
semver
commands =
make --directory ../docs html
Expand Down

0 comments on commit 514aeb6

Please sign in to comment.