Skip to content

Commit

Permalink
docs: small fixes to source API documentation (#498)
Browse files Browse the repository at this point in the history
  • Loading branch information
quentin-quix authored Sep 11, 2024
1 parent 311158c commit 5421e73
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 11 deletions.
3 changes: 1 addition & 2 deletions docs/connectors/sources/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ For multiplatform support, Quix Streams starts the source process using the [spa

Sources work by sending data to Kafka topics. Then StreamingDataFrames consume these topics.

Each source provides a default topic based on its configuration. You can override the default topic by
specifying a topic using the `app.dataframe()` method.
Each source provides a default topic based on its configuration. You can override the default topic by specifying a topic using the `app.dataframe()` method.

**Example**

Expand Down
2 changes: 1 addition & 1 deletion docs/connectors/sources/csv-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ A basic source that reads data from a single CSV file.

The CSV source reads the file, produce the data and exit. It doesn't keep any state. On restart, the whole file will be re-consumed.

## How to use CSV Sourceth
## How to use CSV Source

To use a CSV Source, you need to create and instance of `CSVSource` and pass it to the `app.dataframe()` method.

Expand Down
6 changes: 3 additions & 3 deletions docs/connectors/sources/custom-sources.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

Quix Streams also provides a set of classes to help users implement custom sources.

* [`quixstreams.sources.base.BaseSource`]: This is the base class for all other sources. It defines the must have methods.
* [`quixstreams.sources.base.Source`]: A subclass of `BaseSource` that implements some helpful methods for writing sources. We recommend subclassing `Source` instead of `BaseSource`.
* [`quixstreams.sources.base.Source`](../../api-reference/sources.md#sources): A subclass of `BaseSource` that implements some helpful methods for writing sources. We recommend subclassing `Source` instead of `BaseSource`.
* [`quixstreams.sources.base.BaseSource`](../../api-reference/sources.md#BaseSource): This is the base class for all other sources. It defines the must have methods.

## Source

Expand Down Expand Up @@ -36,7 +36,7 @@ class MySource(Source):
)
```

For more information, see [`quixstreams.sources.base.Source`](../../api-reference/sources.md#sources) docstrings.
For more information, see [`quixstreams.sources.base.Source`](../../api-reference/sources.md#source) docstrings.

## BaseSource

Expand Down
6 changes: 3 additions & 3 deletions quixstreams/sources/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,9 @@ def serialize(
timestamp_ms: Optional[int] = None,
) -> KafkaMessage:
"""
Serialize data to bytes using the producer topic serializers and return a :class:`quixstreams.models.messages.KafkaMessage` .
Serialize data to bytes using the producer topic serializers and return a `quixstreams.models.messages.KafkaMessage`.
:return: :class:`quixstreams.models.messages.KafkaMessage`
:return: `quixstreams.models.messages.KafkaMessage`
"""
return self._producer_topic.serialize(
key=key, value=value, headers=headers, timestamp_ms=timestamp_ms
Expand Down Expand Up @@ -294,7 +294,7 @@ def default_topic(self) -> Topic:
Return a default topic matching the source name.
The default topic will not be used if the topic has already been provided to the source.
:return: `:class:`quixstreams.models.topics.Topic`
:return: `quixstreams.models.topics.Topic`
"""
return Topic(
name=self.name,
Expand Down
2 changes: 1 addition & 1 deletion quixstreams/sources/csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def __init__(
) -> None:
"""
A base CSV source that reads data from a single CSV file.
Best used with :class:`quixstreams.sinks.csv.CSVSink`.
Best used with `quixstreams.sinks.csv.CSVSink`.
Required columns: key, value
Optional columns: timestamp
Expand Down
2 changes: 1 addition & 1 deletion quixstreams/sources/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def start(self) -> "SourceProcess":

def raise_for_error(self) -> None:
"""
Raise a :class:`quixstreams.sources.manager.SourceException`
Raise a `quixstreams.sources.manager.SourceException`
if the child process was terminated with an exception.
"""
if super().is_alive():
Expand Down

0 comments on commit 5421e73

Please sign in to comment.