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: fixes and minor improvements #16

Merged
merged 1 commit into from
May 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
("py:class", "_RDT"), # private type annotations
("py:class", "_PDT"), # private type annotations
("py:class", "Executor"), # sphinx can't find it
("py:class", "Future"), # sphinx can't find it
("py:class", "Processor"), # docs aren't published yet
("py:class", "Retry"), # docs aren't published yet
("py:class", "Sink"), # docs aren't published yet
Expand Down
6 changes: 5 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ API Reference
:caption: API
:recursive:

sghi.etl.commons
sghi.etl.commons.processors
sghi.etl.commons.sinks
sghi.etl.commons.sources
sghi.etl.commons.utils
sghi.etl.commons.workflow_definitions


.. _sghi-etl-core: https://github.com/savannahghi/sghi-etl-core/
Expand Down
15 changes: 11 additions & 4 deletions src/sghi/etl/commons/sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,11 +230,18 @@ def is_disposed(self) -> bool:
def draw(self) -> Sequence[_RDT]:
"""Draw data from embedded sources and return the aggregated results.

This method retrieves data from all embedded sources asynchronously
using the configured :class:`Executor`. It then applies the provided
result-gatherer function to the :class:`Future` objects resulting from
the asynchronous execution. Each of these ``Future`` objects wraps the
result of drawing from each embedded source contained by this
``GatherSource``, and they have the same order.

The contents of the resulting aggregate, and their ordering, are
determined by the result-gatherer function provided at this object's
instantiation. That is, the contents of the returned ``Sequence``, will
be the same as those returned by this object's result-gatherer function
and in the same order.
determined by the provided result-gatherer function. That is, the
contents of the returned ``Sequence``, will be the same as those
returned by this object's result-gatherer function and in the same
order.

.. admonition:: Don't use after dispose
:class: error
Expand Down
2 changes: 1 addition & 1 deletion src/sghi/etl/commons/utils/result_gatherers.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def fail_fast(
exc_wrapper_factory: Callable[[str | None], BaseException] | None = None,
exc_wrapper_message: str | None = None,
) -> Iterable[_T]:
"""Return the results from futures or errors if any of the futures failed.
"""Return the results from futures or error if any of the futures failed.

This function returns an ``Iterable`` of the results or errors(if any of
the futures failed) gathered from the provided
Expand Down