Skip to content

Commit 67a0b23

Browse files
Update documentation (#761)
Co-authored-by: daniil-quix <[email protected]>
1 parent e235d7a commit 67a0b23

File tree

2 files changed

+50
-37
lines changed

2 files changed

+50
-37
lines changed

docs/api-reference/application.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
class Application()
1111
```
1212

13-
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L78)
13+
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L79)
1414

1515
The main Application class.
1616

@@ -67,7 +67,7 @@ def __init__(broker_address: Optional[Union[str, ConnectionConfig]] = None,
6767
commit_every: int = 0,
6868
consumer_extra_config: Optional[dict] = None,
6969
producer_extra_config: Optional[dict] = None,
70-
state_dir: Union[str, Path] = Path("state"),
70+
state_dir: Union[None, str, Path] = None,
7171
rocksdb_options: Optional[RocksDBOptionsType] = None,
7272
on_consumer_error: Optional[ConsumerErrorCallback] = None,
7373
on_processing_error: Optional[ProcessingErrorCallback] = None,
@@ -85,7 +85,7 @@ def __init__(broker_address: Optional[Union[str, ConnectionConfig]] = None,
8585
processing_guarantee: ProcessingGuarantee = "at-least-once")
8686
```
8787

88-
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L116)
88+
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L117)
8989

9090

9191
<br>
@@ -174,7 +174,7 @@ instead of the default one.
174174
def Quix(cls, *args, **kwargs)
175175
```
176176

177-
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L358)
177+
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L361)
178178

179179
RAISES EXCEPTION: DEPRECATED.
180180

@@ -197,7 +197,7 @@ def topic(name: str,
197197
timestamp_extractor: Optional[TimestampExtractor] = None) -> Topic
198198
```
199199

200-
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L390)
200+
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L393)
201201

202202
Create a topic definition.
203203

@@ -279,7 +279,7 @@ def dataframe(topic: Optional[Topic] = None,
279279
source: Optional[BaseSource] = None) -> StreamingDataFrame
280280
```
281281

282-
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L470)
282+
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L473)
283283

284284
A simple helper method that generates a `StreamingDataFrame`, which is used
285285

@@ -335,7 +335,7 @@ to be used as an input topic.
335335
def stop(fail: bool = False)
336336
```
337337

338-
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L526)
338+
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L529)
339339

340340
Stop the internal poll loop and the message processing.
341341

@@ -362,7 +362,7 @@ to unhandled exception, and it shouldn't commit the current checkpoint.
362362
def get_producer() -> Producer
363363
```
364364

365-
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L571)
365+
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L574)
366366

367367
Create and return a pre-configured Producer instance.
368368
The Producer is initialized with params passed to Application.
@@ -397,7 +397,7 @@ with app.get_producer() as producer:
397397
def get_consumer(auto_commit_enable: bool = True) -> Consumer
398398
```
399399

400-
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L626)
400+
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L629)
401401

402402
Create and return a pre-configured Consumer instance.
403403

@@ -454,7 +454,7 @@ with app.get_consumer() as consumer:
454454
def clear_state()
455455
```
456456

457-
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L676)
457+
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L679)
458458

459459
Clear the state of the application.
460460

@@ -468,7 +468,7 @@ Clear the state of the application.
468468
def add_source(source: BaseSource, topic: Optional[Topic] = None) -> Topic
469469
```
470470

471-
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L682)
471+
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L685)
472472

473473
Add a source to the application.
474474

@@ -495,7 +495,7 @@ Note: the names of default topics are prefixed with "source__".
495495
def run(dataframe: Optional[StreamingDataFrame] = None)
496496
```
497497

498-
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L715)
498+
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L718)
499499

500500
Start processing data from Kafka using provided `StreamingDataFrame`
501501

@@ -531,7 +531,7 @@ app.run()
531531
def setup_topics()
532532
```
533533

534-
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L840)
534+
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L843)
535535

536536
Validate and create the topics
537537

@@ -543,7 +543,7 @@ Validate and create the topics
543543
class ApplicationConfig(BaseSettings)
544544
```
545545

546-
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L1028)
546+
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L1031)
547547

548548
Immutable object holding the application configuration
549549

@@ -566,7 +566,7 @@ def settings_customise_sources(
566566
) -> Tuple[PydanticBaseSettingsSource, ...]
567567
```
568568

569-
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L1063)
569+
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L1066)
570570

571571
Included to ignore reading/setting values from the environment
572572

@@ -580,7 +580,7 @@ Included to ignore reading/setting values from the environment
580580
def copy(**kwargs) -> Self
581581
```
582582

583-
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L1076)
583+
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L1079)
584584

585585
Update the application config and return a copy
586586

docs/api-reference/quixstreams.md

Lines changed: 34 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -530,29 +530,42 @@ path to state dir
530530

531531
## quixstreams.platforms.quix.checks
532532

533+
<a id="quixstreams.platforms.quix.checks.is_quix_deployment"></a>
534+
535+
#### is\_quix\_deployment
536+
537+
```python
538+
def is_quix_deployment() -> bool
539+
```
540+
541+
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/platforms/quix/checks.py#L11)
542+
543+
Check if the current deployment is a Quix deployment.
544+
533545
<a id="quixstreams.platforms.quix.checks.check_state_management_enabled"></a>
534546

535547
#### check\_state\_management\_enabled
536548

537549
```python
538-
def check_state_management_enabled()
550+
def check_state_management_enabled() -> None
539551
```
540552

541-
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/platforms/quix/checks.py#L11)
553+
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/platforms/quix/checks.py#L18)
542554

543555
Check if State Management feature is enabled for the current deployment on
544556
Quix platform.
545-
If it's disabled, the exception will be raised.
557+
558+
If it's disabled, the warning will be logged.
546559

547560
<a id="quixstreams.platforms.quix.checks.check_state_dir"></a>
548561

549562
#### check\_state\_dir
550563

551564
```python
552-
def check_state_dir(state_dir: Path)
565+
def check_state_dir(state_dir: Path) -> None
553566
```
554567

555-
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/platforms/quix/checks.py#L28)
568+
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/platforms/quix/checks.py#L36)
556569

557570
Check if Application "state_dir" matches the state dir on Quix platform.
558571

@@ -11029,7 +11042,7 @@ Used by the producer during consumer offset sending for an EOS transaction.
1102911042
class Application()
1103011043
```
1103111044

11032-
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L78)
11045+
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L79)
1103311046

1103411047
The main Application class.
1103511048

@@ -11080,7 +11093,7 @@ def __init__(broker_address: Optional[Union[str, ConnectionConfig]] = None,
1108011093
commit_every: int = 0,
1108111094
consumer_extra_config: Optional[dict] = None,
1108211095
producer_extra_config: Optional[dict] = None,
11083-
state_dir: Union[str, Path] = Path("state"),
11096+
state_dir: Union[None, str, Path] = None,
1108411097
rocksdb_options: Optional[RocksDBOptionsType] = None,
1108511098
on_consumer_error: Optional[ConsumerErrorCallback] = None,
1108611099
on_processing_error: Optional[ProcessingErrorCallback] = None,
@@ -11098,7 +11111,7 @@ def __init__(broker_address: Optional[Union[str, ConnectionConfig]] = None,
1109811111
processing_guarantee: ProcessingGuarantee = "at-least-once")
1109911112
```
1110011113

11101-
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L116)
11114+
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L117)
1110211115

1110311116
**Arguments**:
1110411117

@@ -11183,7 +11196,7 @@ instead of the default one.
1118311196
def Quix(cls, *args, **kwargs)
1118411197
```
1118511198

11186-
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L358)
11199+
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L361)
1118711200

1118811201
RAISES EXCEPTION: DEPRECATED.
1118911202

@@ -11204,7 +11217,7 @@ def topic(name: str,
1120411217
timestamp_extractor: Optional[TimestampExtractor] = None) -> Topic
1120511218
```
1120611219

11207-
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L390)
11220+
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L393)
1120811221

1120911222
Create a topic definition.
1121011223

@@ -11276,7 +11289,7 @@ def dataframe(topic: Optional[Topic] = None,
1127611289
source: Optional[BaseSource] = None) -> StreamingDataFrame
1127711290
```
1127811291

11279-
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L470)
11292+
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L473)
1128011293

1128111294
A simple helper method that generates a `StreamingDataFrame`, which is used
1128211295

@@ -11324,7 +11337,7 @@ to be used as an input topic.
1132411337
def stop(fail: bool = False)
1132511338
```
1132611339

11327-
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L526)
11340+
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L529)
1132811341

1132911342
Stop the internal poll loop and the message processing.
1133011343

@@ -11347,7 +11360,7 @@ to unhandled exception, and it shouldn't commit the current checkpoint.
1134711360
def get_producer() -> Producer
1134811361
```
1134911362

11350-
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L571)
11363+
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L574)
1135111364

1135211365
Create and return a pre-configured Producer instance.
1135311366
The Producer is initialized with params passed to Application.
@@ -11378,7 +11391,7 @@ with app.get_producer() as producer:
1137811391
def get_consumer(auto_commit_enable: bool = True) -> Consumer
1137911392
```
1138011393

11381-
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L626)
11394+
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L629)
1138211395

1138311396
Create and return a pre-configured Consumer instance.
1138411397

@@ -11429,7 +11442,7 @@ Default - True
1142911442
def clear_state()
1143011443
```
1143111444

11432-
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L676)
11445+
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L679)
1143311446

1143411447
Clear the state of the application.
1143511448

@@ -11441,7 +11454,7 @@ Clear the state of the application.
1144111454
def add_source(source: BaseSource, topic: Optional[Topic] = None) -> Topic
1144211455
```
1144311456

11444-
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L682)
11457+
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L685)
1144511458

1144611459
Add a source to the application.
1144711460

@@ -11464,7 +11477,7 @@ Note: the names of default topics are prefixed with "source__".
1146411477
def run(dataframe: Optional[StreamingDataFrame] = None)
1146511478
```
1146611479

11467-
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L715)
11480+
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L718)
1146811481

1146911482
Start processing data from Kafka using provided `StreamingDataFrame`
1147011483

@@ -11496,7 +11509,7 @@ app.run()
1149611509
def setup_topics()
1149711510
```
1149811511

11499-
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L840)
11512+
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L843)
1150011513

1150111514
Validate and create the topics
1150211515

@@ -11508,7 +11521,7 @@ Validate and create the topics
1150811521
class ApplicationConfig(BaseSettings)
1150911522
```
1151011523

11511-
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L1028)
11524+
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L1031)
1151211525

1151311526
Immutable object holding the application configuration
1151411527

@@ -11529,7 +11542,7 @@ def settings_customise_sources(
1152911542
) -> Tuple[PydanticBaseSettingsSource, ...]
1153011543
```
1153111544

11532-
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L1063)
11545+
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L1066)
1153311546

1153411547
Included to ignore reading/setting values from the environment
1153511548

@@ -11541,7 +11554,7 @@ Included to ignore reading/setting values from the environment
1154111554
def copy(**kwargs) -> Self
1154211555
```
1154311556

11544-
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L1076)
11557+
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L1079)
1154511558

1154611559
Update the application config and return a copy
1154711560

0 commit comments

Comments
 (0)