-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DEV-2679 better kinesis source docs (#334)
- Loading branch information
Showing
3 changed files
with
47 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -168,6 +168,7 @@ schemas | |
SDK | ||
SearchRequest | ||
SHA | ||
ShardIteratorType | ||
Signifier | ||
signup | ||
SLA | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
from datetime import datetime, timedelta | ||
from datetime import datetime | ||
|
||
import pandas as pd | ||
|
||
|
@@ -167,8 +167,9 @@ class UserKafkaSourcedDataset: | |
) | ||
stream = kinesis.stream( | ||
stream_arn="<SOME_STREAM_ARN>", | ||
# Start ingesting from Nov 5, 2023 | ||
init_position=InitPosition.AT_TIMESTAMP, | ||
init_timestamp=datetime.now() - timedelta(days=14), | ||
init_timestamp=datetime(2023, 11, 5), | ||
) | ||
|
||
|
||
|
@@ -182,6 +183,32 @@ class UserKinesisSourcedDataset: | |
... | ||
|
||
|
||
# /docsnip | ||
|
||
# docsnip kinesis_source_latest | ||
from fennel.sources import InitPosition | ||
|
||
kinesis = sources.Kinesis( | ||
name="kinesis_src", | ||
role_arn="<SOME_ROLE_ARN>", | ||
) | ||
stream = kinesis.stream( | ||
stream_arn="<SOME_STREAM_ARN>", | ||
# Ingest all new records from now | ||
init_position=InitPosition.LATEST, | ||
) | ||
|
||
|
||
@source(stream) | ||
@meta(owner="[email protected]") | ||
@dataset | ||
class UserKinesisSourcedDataset2: | ||
uid: int = field(key=True) | ||
email: str | ||
timestamp: datetime | ||
... | ||
|
||
|
||
# /docsnip | ||
|
||
# docsnip s3_delta_lake_source | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters