- Notifications
You must be signed in to change notification settings - Fork248
Failed rows config WIP#2318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Open
m1n0 wants to merge27 commits intov4Choose a base branch fromv4-failedrows-config
base:v4
Could not load branches
Branch not found:{{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline, and old review comments may become outdated.
Uh oh!
There was an error while loading.Please reload this page.
Open
Changes from1 commit
Commits
Show all changes
27 commits Select commitHold shift + click to select a range
bd1e649 failed rows wip
tombaeyensf37e783 Failed rows wip
tombaeyensb097f27 failed rows wip
tombaeyensa286dbc Fixed extension mechanism
tombaeyens8b47953 Failed rows wip
tombaeyens1f5ca20 Implement proper status handling for both local and remote contract v…
nielsn2351523 Add dotenv to deps (#2305)
m1n09b99876 Fix diagnostics, support date-like in freshness (#2307)
m1n06744f3d Bump contract json schema (#2308)
m1n02ced0a8 Fix freshness if no data, handle corner cases better (#2309)
m1n0b919b45 Use question mark char for not_evaluated (#2310)
m1n083d75ac DTL-807: Floor the current freshness in seconds so it returns an `int…
nielsn587ab8c V4 datatime2 (#2311)
tombaeyens100dd75 Default check names (#2317)
tombaeyens2e31e46 failed rows wip
tombaeyensf9e5fff Failed rows extension wip
tombaeyens11b2eb8 [pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot]ad9134e Failed rows wip
tombaeyenseeb99e6 Failed rows keys wip
tombaeyensc5e4877 Failed rows keys wip
tombaeyens460a483 Failed rows wip
tombaeyensd1d78f6 failed rows wip
tombaeyens920778a Failed rows wip
tombaeyens8560ca6 Added diagnostics check results table
tombaeyens7971d23 Merge branch 'v4' into v4-failedrowsext
tombaeyensa23444b Failed rows config WIP
m1n02e94aac Failed rows config WIP
m1n0File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
Failed rows config WIP
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
commita23444bc90fefc6da04a05dd5048f2add71dba96
There are no files selected for viewing
4 changes: 3 additions & 1 deletionsoda-core/src/soda_core/model/data_source/data_source.py
This file contains hidden or 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
79 changes: 79 additions & 0 deletionssoda-core/src/soda_core/model/failed_rows.py
This file contains hidden or 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,79 @@ | ||
| import abc | ||
| from enum import Enum | ||
| from typing import Optional | ||
| from pydantic import BaseModel, Field | ||
| DEFAULT_SCHEMA = "failed_rows" | ||
| class FailedRowsStrategy(str, Enum): | ||
| """Enum for failed rows strategy""" | ||
| NONE = "none" | ||
| STORE_DIAGNOSTICS = "store_diagnostics" | ||
| STORE_KEYS = "store_keys" | ||
| STORE_DATA = "store_data" | ||
| class FailedRowsConfigBase( | ||
| BaseModel, | ||
| abc.ABC, | ||
| frozen=True, | ||
| extra="forbid", | ||
| validate_by_name=True, # Allow to use both field names and aliases when populating from dict | ||
| ): | ||
| enabled: Optional[bool] = Field( | ||
| None, | ||
| description="Enable or disable the storage of failed rows. " "If set to false, failed rows will not be stored.", | ||
| ) | ||
| class FailedRowsConfigOrganisation(FailedRowsConfigBase): | ||
| """Top-level configuration for failed rows, used on Soda Cloud.""" | ||
| # Overrides the `enabled` field on other levels as Cloud config will return a bool always. | ||
| enabled: bool = Field( | ||
| ..., | ||
| description="Enable or disable the storage of failed rows. " "If set to false, failed rows will not be stored.", | ||
| ) | ||
| path_default: Optional[str] = Field( | ||
| "{{ data_source.database }}/{DEFAULT_SCHEMA}", # TODO: revisit | ||
| description="Path to the warehouse location where failed rows will be stored. ", | ||
| ) | ||
| enabled_by_default: bool = Field( | ||
| True, | ||
| description="Enable or disable the storage of failed rows by default. Does not override the `enabled` setting if `enabled` is set to false." | ||
| "If set to false, failed rows will not be stored unless explicitly enabled in the contract or check.", | ||
| ) | ||
| strategy_default: FailedRowsStrategy = Field( | ||
| FailedRowsStrategy.STORE_DIAGNOSTICS, description="Default strategy for storing failed rows." | ||
| ) | ||
| class FailedRowsConfigDatasource(FailedRowsConfigBase): | ||
| """Top-level configuration for failed rows, on data source level.""" | ||
| path: Optional[str] = Field(..., description="Path to the warehouse location where failed rows will be stored.") | ||
| enabled_by_default: Optional[bool] = Field( | ||
| True, | ||
| description="Enable or disable the storage of failed rows by default. Does not override the `enabled` setting if `enabled` is set to false." | ||
| "If set to false, failed rows will not be stored unless explicitly enabled in the contract or check.", | ||
| ) | ||
| strategy_default: Optional[FailedRowsStrategy] = Field( | ||
| FailedRowsStrategy.STORE_DIAGNOSTICS, description="Default strategy for storing failed rows." | ||
| ) | ||
| class FailedRowsConfigContract(FailedRowsConfigBase): | ||
| """Configuration for failed rows at the contract level.""" | ||
| path: Optional[str] = Field(..., description="Path to the warehouse location where failed rows will be stored.") | ||
| strategy: Optional[FailedRowsStrategy] = Field(..., description="Strategy for storing failed rows.") | ||
| class FailedRowsConfigCheck(FailedRowsConfigBase): | ||
| """Configuration for failed rows at the check level.""" | ||
| strategy: Optional[FailedRowsStrategy] = Field(..., description="Strategy for storing failed rows.") |
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.