Documentation ¶
Index ¶
- func CallFuncForEveryAsset(callable AssetValidator) func(pipeline *pipeline.Pipeline) ([]*Issue, error)
- func EnsureNoNestedPipelines(pipelinePaths []string) error
- type AssetValidator
- type GlossaryChecker
- type Issue
- func EnsureBigQueryQuerySensorHasTableParameterForASingleAsset(ctx context.Context, p *pipeline.Pipeline, asset *pipeline.Asset) ([]*Issue, error)
- func EnsureBigQueryTableSensorHasTableParameterForASingleAsset(ctx context.Context, p *pipeline.Pipeline, asset *pipeline.Asset) ([]*Issue, error)
- func EnsureDependencyExistsForASingleAsset(ctx context.Context, p *pipeline.Pipeline, task *pipeline.Asset) ([]*Issue, error)
- func EnsureIngestrAssetIsValidForASingleAsset(ctx context.Context, p *pipeline.Pipeline, asset *pipeline.Asset) ([]*Issue, error)
- func EnsureMSTeamsFieldInPipelineIsValid(p *pipeline.Pipeline) ([]*Issue, error)
- func EnsureMaterializationValuesAreValidForSingleAsset(ctx context.Context, p *pipeline.Pipeline, asset *pipeline.Asset) ([]*Issue, error)
- func EnsurePipelineHasNoCycles(p *pipeline.Pipeline) ([]*Issue, error)
- func EnsurePipelineNameIsValid(pipeline *pipeline.Pipeline) ([]*Issue, error)
- func EnsurePipelineScheduleIsValidCron(p *pipeline.Pipeline) ([]*Issue, error)
- func EnsurePipelineStartDateIsValid(p *pipeline.Pipeline) ([]*Issue, error)
- func EnsureSlackFieldInPipelineIsValid(p *pipeline.Pipeline) ([]*Issue, error)
- func EnsureSnowflakeSensorHasQueryParameterForASingleAsset(ctx context.Context, p *pipeline.Pipeline, asset *pipeline.Asset) ([]*Issue, error)
- func EnsureTaskNameIsUnique(p *pipeline.Pipeline) ([]*Issue, error)
- func EnsureTaskNameIsUniqueForASingleAsset(ctx context.Context, p *pipeline.Pipeline, asset *pipeline.Asset) ([]*Issue, error)
- func EnsureTaskNameIsValidForASingleAsset(ctx context.Context, p *pipeline.Pipeline, asset *pipeline.Asset) ([]*Issue, error)
- func EnsureTypeIsCorrectForASingleAsset(ctx context.Context, p *pipeline.Pipeline, asset *pipeline.Asset) ([]*Issue, error)
- func ValidateAssetDirectoryExist(p *pipeline.Pipeline) ([]*Issue, error)
- func ValidateDuplicateColumnNames(ctx context.Context, p *pipeline.Pipeline, asset *pipeline.Asset) ([]*Issue, error)
- func ValidateInvalidPythonModuleName(ctx context.Context, p *pipeline.Pipeline, asset *pipeline.Asset) ([]*Issue, error)
- type Level
- type Linter
- func (l *Linter) Lint(rootPath, pipelineDefinitionFileName string) (*PipelineAnalysisResult, error)
- func (l *Linter) LintAsset(rootPath, pipelineDefinitionFileName, assetNameOrPath string) (*PipelineAnalysisResult, error)
- func (l *Linter) LintPipeline(p *pipeline.Pipeline) (*PipelineIssues, error)
- func (l *Linter) LintPipelines(pipelines []*pipeline.Pipeline) (*PipelineAnalysisResult, error)
- type PipelineAnalysisResult
- type PipelineIssues
- type PipelineValidator
- type Printer
- type QueryValidatorRule
- func (q *QueryValidatorRule) GetApplicableLevels() []Level
- func (q *QueryValidatorRule) GetSeverity() ValidatorSeverity
- func (q *QueryValidatorRule) IsFast() bool
- func (q *QueryValidatorRule) Name() string
- func (q *QueryValidatorRule) Validate(p *pipeline.Pipeline) ([]*Issue, error)
- func (q *QueryValidatorRule) ValidateAsset(ctx context.Context, p *pipeline.Pipeline, asset *pipeline.Asset) ([]*Issue, error)
- type Rule
- type SimpleRule
- func (g *SimpleRule) GetApplicableLevels() []Level
- func (g *SimpleRule) GetSeverity() ValidatorSeverity
- func (g *SimpleRule) IsFast() bool
- func (g *SimpleRule) Name() string
- func (g *SimpleRule) Validate(pipeline *pipeline.Pipeline) ([]*Issue, error)
- func (g *SimpleRule) ValidateAsset(ctx context.Context, pipeline *pipeline.Pipeline, asset *pipeline.Asset) ([]*Issue, error)
- type UsedTableValidatorRule
- func (u UsedTableValidatorRule) GetApplicableLevels() []Level
- func (u UsedTableValidatorRule) GetSeverity() ValidatorSeverity
- func (u UsedTableValidatorRule) IsFast() bool
- func (u UsedTableValidatorRule) Name() string
- func (u UsedTableValidatorRule) Validate(p *pipeline.Pipeline) ([]*Issue, error)
- func (u UsedTableValidatorRule) ValidateAsset(ctx context.Context, p *pipeline.Pipeline, asset *pipeline.Asset) ([]*Issue, error)
- type ValidatorSeverity
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CallFuncForEveryAsset ¶ added in v0.6.6
func CallFuncForEveryAsset(callable AssetValidator) func(pipeline *pipeline.Pipeline) ([]*Issue, error)
func EnsureNoNestedPipelines ¶ added in v0.4.1
Types ¶
type AssetValidator ¶ added in v0.5.6
type AssetValidator func(ctx context.Context, pipeline *pipeline.Pipeline, asset *pipeline.Asset) ([]*Issue, error)
func EnsureExecutableFileIsValidForASingleAsset ¶ added in v0.5.6
func EnsureExecutableFileIsValidForASingleAsset(fs afero.Fs) AssetValidator
type GlossaryChecker ¶ added in v0.11.9
type GlossaryChecker struct {
// contains filtered or unexported fields
}
type Issue ¶
func EnsureBigQueryQuerySensorHasTableParameterForASingleAsset ¶ added in v0.9.6
func EnsureBigQueryTableSensorHasTableParameterForASingleAsset ¶ added in v0.7.4
func EnsureDependencyExistsForASingleAsset ¶ added in v0.5.6
func EnsureIngestrAssetIsValidForASingleAsset ¶ added in v0.6.6
func EnsureMSTeamsFieldInPipelineIsValid ¶ added in v0.11.20
func EnsureMaterializationValuesAreValidForSingleAsset ¶ added in v0.5.6
func EnsurePipelineHasNoCycles ¶
EnsurePipelineHasNoCycles ensures that the pipeline is a DAG, and contains no cycles. Since the pipelines are directed graphs, strongly connected components mean cycles, therefore they would be considered invalid for our pipelines. Strong connectivity wouldn't work for tasks that depend on themselves, therefore there's a specific check for that.
func EnsurePipelineStartDateIsValid ¶ added in v0.11.8
func EnsureSnowflakeSensorHasQueryParameterForASingleAsset ¶ added in v0.5.6
func EnsureTaskNameIsUniqueForASingleAsset ¶ added in v0.5.6
func EnsureTaskNameIsValidForASingleAsset ¶ added in v0.5.6
func EnsureTypeIsCorrectForASingleAsset ¶ added in v0.5.6
func ValidateAssetDirectoryExist ¶ added in v0.11.55
func ValidateDuplicateColumnNames ¶ added in v0.11.35
func ValidateDuplicateColumnNames(ctx context.Context, p *pipeline.Pipeline, asset *pipeline.Asset) ([]*Issue, error)
ValidateDuplicateColumnNames checks for duplicate column names within a single asset. It returns a slice of Issues, each representing a duplicate column name found.
The function performs a case-insensitive comparison of column names.
Parameters:
- ctx: The context for the validation operation
- p: A pointer to the pipeline.Pipeline struct
- asset: The pipeline.Asset to be validated for duplicate column names.
Returns:
- A slice of *Issue, each describing a duplicate column name found.
- An error, which is always nil in this implementation.
type Linter ¶
type Linter struct {
// contains filtered or unexported fields
}
func NewLinter ¶
func NewLinter(findPipelines pipelineFinder, builder pipelineBuilder, rules []Rule, logger *zap.SugaredLogger) *Linter
func (*Linter) Lint ¶
func (l *Linter) Lint(rootPath, pipelineDefinitionFileName string) (*PipelineAnalysisResult, error)
func (*Linter) LintAsset ¶ added in v0.5.6
func (l *Linter) LintAsset(rootPath, pipelineDefinitionFileName, assetNameOrPath string) (*PipelineAnalysisResult, error)
func (*Linter) LintPipeline ¶ added in v0.4.1
func (l *Linter) LintPipeline(p *pipeline.Pipeline) (*PipelineIssues, error)
func (*Linter) LintPipelines ¶
func (l *Linter) LintPipelines(pipelines []*pipeline.Pipeline) (*PipelineAnalysisResult, error)
type PipelineAnalysisResult ¶
type PipelineAnalysisResult struct {
Pipelines []*PipelineIssues `json:"pipelines"`
}
func (*PipelineAnalysisResult) ErrorCount ¶
func (p *PipelineAnalysisResult) ErrorCount() int
ErrorCount returns the number of errors found in an analysis result.
func (*PipelineAnalysisResult) MarshalJSON ¶ added in v0.6.8
func (p *PipelineAnalysisResult) MarshalJSON() ([]byte, error)
func (*PipelineAnalysisResult) WarningCount ¶ added in v0.11.14
func (p *PipelineAnalysisResult) WarningCount() int
WarningCount returns the number of warnings, a.k.a non-critical issues found in an analysis result.
type PipelineIssues ¶
func RunLintRulesOnPipeline ¶ added in v0.4.1
func RunLintRulesOnPipeline(p *pipeline.Pipeline, rules []Rule) (*PipelineIssues, error)
func (*PipelineIssues) MarshalJSON ¶ added in v0.6.8
func (p *PipelineIssues) MarshalJSON() ([]byte, error)
type Printer ¶
type Printer struct {
RootCheckPath string
}
func (*Printer) PrintIssues ¶
func (l *Printer) PrintIssues(analysis *PipelineAnalysisResult)
func (*Printer) PrintJSON ¶ added in v0.6.8
func (l *Printer) PrintJSON(analysis *PipelineAnalysisResult) error
type QueryValidatorRule ¶
type QueryValidatorRule struct { Identifier string Fast bool TaskType pipeline.AssetType Connections connectionManager Extractor queryExtractor Materializer materializer WorkerCount int Logger *zap.SugaredLogger }
func (*QueryValidatorRule) GetApplicableLevels ¶ added in v0.5.6
func (q *QueryValidatorRule) GetApplicableLevels() []Level
func (*QueryValidatorRule) GetSeverity ¶ added in v0.11.14
func (q *QueryValidatorRule) GetSeverity() ValidatorSeverity
func (*QueryValidatorRule) IsFast ¶ added in v0.11.53
func (q *QueryValidatorRule) IsFast() bool
func (*QueryValidatorRule) Name ¶
func (q *QueryValidatorRule) Name() string
type Rule ¶
type Rule interface { Name() string IsFast() bool Validate(pipeline *pipeline.Pipeline) ([]*Issue, error) ValidateAsset(ctx context.Context, pipeline *pipeline.Pipeline, asset *pipeline.Asset) ([]*Issue, error) GetApplicableLevels() []Level GetSeverity() ValidatorSeverity }
func FilterRulesByLevel ¶ added in v0.5.6
func FilterRulesBySpeed ¶ added in v0.11.53
type SimpleRule ¶
type SimpleRule struct { Identifier string Fast bool Validator PipelineValidator AssetValidator AssetValidator ApplicableLevels []Level Severity ValidatorSeverity }
func (*SimpleRule) GetApplicableLevels ¶ added in v0.5.6
func (g *SimpleRule) GetApplicableLevels() []Level
func (*SimpleRule) GetSeverity ¶ added in v0.11.14
func (g *SimpleRule) GetSeverity() ValidatorSeverity
func (*SimpleRule) IsFast ¶ added in v0.11.53
func (g *SimpleRule) IsFast() bool
func (*SimpleRule) Name ¶
func (g *SimpleRule) Name() string
type UsedTableValidatorRule ¶ added in v0.11.14
type UsedTableValidatorRule struct {
// contains filtered or unexported fields
}
func (UsedTableValidatorRule) GetApplicableLevels ¶ added in v0.11.14
func (u UsedTableValidatorRule) GetApplicableLevels() []Level
func (UsedTableValidatorRule) GetSeverity ¶ added in v0.11.14
func (u UsedTableValidatorRule) GetSeverity() ValidatorSeverity
func (UsedTableValidatorRule) IsFast ¶ added in v0.11.53
func (u UsedTableValidatorRule) IsFast() bool
func (UsedTableValidatorRule) Name ¶ added in v0.11.14
func (u UsedTableValidatorRule) Name() string
type ValidatorSeverity ¶ added in v0.11.14
type ValidatorSeverity int
const ( ValidatorSeverityWarning ValidatorSeverity = iota ValidatorSeverityCritical )