-
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-3403 Introduce until to the client (#394)
* Add test_lib to gitignore since gen_rust_lib changes on int test building
- Loading branch information
Showing
13 changed files
with
387 additions
and
288 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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
**/.DS_Store | ||
fennel/proto/*.proto | ||
fennel/test_lib/ | ||
output.txt | ||
|
||
# Byte-compiled / optimized / DLL files | ||
|
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
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
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
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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 |
---|---|---|
|
@@ -328,6 +328,59 @@ class UserInfoDataset: | |
) | ||
|
||
|
||
def test_invalid_until(): | ||
with pytest.raises(Exception) as e: | ||
|
||
@source( | ||
s3.bucket(bucket_name="bucket", prefix="prefix"), | ||
every="1h", | ||
disorder="14d", | ||
cdc="append", | ||
until="2020-01-01T00:00:00Z", | ||
) | ||
@meta(owner="[email protected]") | ||
@dataset | ||
class UserInfoDataset: | ||
user_id: int = field(key=True) | ||
name: str | ||
gender: str | ||
# Users date of birth | ||
dob: str | ||
age: int | ||
account_creation_date: datetime | ||
country: Optional[str] | ||
timestamp: datetime = field(timestamp=True) | ||
|
||
assert "'until' must be of type datetime - got <class 'str'>" == str( | ||
e.value | ||
) | ||
|
||
with pytest.raises(ValueError) as e: | ||
|
||
@source( | ||
s3.bucket(bucket_name="bucket", prefix="prefix"), | ||
every="1h", | ||
disorder="14d", | ||
cdc="append", | ||
since=datetime(2024, 1, 1), | ||
until=datetime(2023, 12, 1), | ||
) | ||
@meta(owner="[email protected]") | ||
@dataset | ||
class UserInfoDataset2: | ||
user_id: int = field(key=True) | ||
name: str | ||
gender: str | ||
# Users date of birth | ||
dob: str | ||
age: int | ||
account_creation_date: datetime | ||
country: Optional[str] | ||
timestamp: datetime = field(timestamp=True) | ||
|
||
assert ("must be earlier than 'until'") in str(e.value) | ||
|
||
|
||
def test_invalid_s3_format(): | ||
with pytest.raises(Exception) as e: | ||
s3.bucket(bucket_name="bucket", prefix="prefix", format="py") | ||
|
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
Oops, something went wrong.