forked from bizon-data/bizon-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: pipeline error handling and CLI return status (#4)
* feat: implement failure handling for pipeline (#1) * wip * wip * Update gorgias.yml * Update gorgias.yml * wip * feat: add destination unnesting for file * feat: assert schema is provided if unnest set to True * add test for config parsing unnest * Update process.py * chore: test shutdown wait true pending * chore(fix): cast bizon date columns as string in bq_streaming * feat: implement stop events, runner status, refacto time partitioning * fix test * delete gha --------- Co-authored-by: Anas El Mhamdi <[email protected]> * feat(cli): raise python error if pipeline error (#3) * fix: multiprocessing event type * feat: cli return exist code 1 if pipeline error * cli raises clickException * always run pytest on PR --------- Co-authored-by: Anas El Mhamdi <[email protected]>
- Loading branch information
1 parent
19127b5
commit 034925b
Showing
11 changed files
with
83 additions
and
11 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 |
---|---|---|
|
@@ -2,7 +2,6 @@ name: Pytest bizon | |
|
||
on: | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
permissions: | ||
contents: read | ||
|
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
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
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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import tempfile | ||
|
||
from click.testing import CliRunner | ||
|
||
from bizon.cli.main import cli | ||
|
||
BIZON_CONFIG_DUMMY_TO_FILE = f""" | ||
name: test_job_3 | ||
source: | ||
source_name: dummy | ||
stream_name: creatures | ||
authentication: | ||
type: api_key | ||
params: | ||
token: dummy_key | ||
sleep: 2 | ||
destination: | ||
name: file | ||
config: | ||
filepath: test.jsonl | ||
transforms: | ||
- label: transform_data | ||
python: | | ||
if 'name' in data: | ||
data['name'] = data['this_key_doesnt_exist'].upper() | ||
""" | ||
|
||
|
||
def test_e2e_run_command_dummy_to_file(): | ||
|
||
runner = CliRunner(mix_stderr=False) | ||
|
||
with tempfile.NamedTemporaryFile(delete=False) as temp: | ||
# Write config in temp file | ||
with open(temp.name, "w") as f: | ||
f.write(BIZON_CONFIG_DUMMY_TO_FILE) | ||
|
||
runner = CliRunner(mix_stderr=False) | ||
result = runner.invoke(cli, ["run", temp.name]) | ||
|
||
assert result.exit_code == 1 | ||
assert ( | ||
"Pipeline finished with status Failure (Producer: killed_by_runner, Consumer: transform_error)" | ||
in result.stderr | ||
) |
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