Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
6694cd1
implement validators and transformer
pnilan May 6, 2025
4dbd363
create config transformations
pnilan May 6, 2025
03e776c
remove unnecessary validation strategies
pnilan May 7, 2025
41f376b
chore: format code
pnilan May 7, 2025
454cb78
add tests for dpath validator
pnilan May 7, 2025
54f9f9f
add predicate validator tests
pnilan May 7, 2025
7881f9f
add tests for RemapField
pnilan May 8, 2025
f8c252b
create tests for ValidateAdheresToSchema
pnilan May 8, 2025
c492b81
chore: type check
pnilan May 8, 2025
48e5ab0
chore: lint
pnilan May 8, 2025
3623325
add test for json strings
pnilan May 8, 2025
dad6100
fix errant inclusion
pnilan May 8, 2025
565b709
add json string parsing to ValidateAdheresToSchema
pnilan May 8, 2025
01415e2
chore: lint
pnilan May 8, 2025
7149962
Merge branch 'main' into pnilan/feat/implement-validators
pnilan May 8, 2025
953ad41
Merge branch 'main' into pnilan/feat/implement-validators
pnilan May 8, 2025
53a5724
fix anyio issue
pnilan May 8, 2025
d3287a1
add declarative component schema
pnilan May 8, 2025
f72efc0
fix assertions
pnilan May 8, 2025
7927a14
remove re-raise
pnilan May 8, 2025
cf1b01c
update tests and error handling for dpath validator
pnilan May 9, 2025
4727b28
fix predicate validator test
pnilan May 9, 2025
a29e424
Merge branch 'pnilan/feat/implement-validators' into pnilan/feat/exte…
pnilan May 12, 2025
5235e6c
update typo
pnilan May 12, 2025
4bdc3a7
initialize empty arrays
pnilan May 12, 2025
45b47f4
initialize empty list via field
pnilan May 12, 2025
fa04b9d
update create_spec to build migration/transform/validation components
pnilan May 12, 2025
036c2e5
chore: type-check, lint, format
pnilan May 12, 2025
711384c
implement config transformations: AddFields and RemoveFields`
pnilan May 13, 2025
70785b8
Merge branch 'pnilan/feat/implement-validators' into pnilan/feat/exte…
pnilan May 13, 2025
fb7d1e9
fix module and classname conflicts
pnilan May 13, 2025
c64e588
chore: lint
pnilan May 13, 2025
01cf5a6
update remap to handle interpolated keys/values
pnilan May 13, 2025
a2dc105
chore: format
pnilan May 13, 2025
18154a1
Merge branch 'pnilan/feat/implement-validators' into pnilan/feat/exte…
pnilan May 13, 2025
4e6ed3b
update component schema for new transformations
pnilan May 14, 2025
833d9e7
update transformations per comments
pnilan May 14, 2025
c251f42
Merge branch 'pnilan/feat/implement-validators' into pnilan/feat/exte…
pnilan May 14, 2025
ff10aa3
add ConfigMigration class and new spec tests
pnilan May 15, 2025
e36067a
Merge branch 'main' into pnilan/feat/extend-spec-class-for-config-mig…
pnilan May 15, 2025
12043e5
chore: format
pnilan May 15, 2025
9cc4d11
remove errant dependencies
pnilan May 15, 2025
1d908a4
fix errors
pnilan May 15, 2025
ded5fcb
revert erroneous AI deletion
pnilan May 15, 2025
3638129
Merge branch 'main' into pnilan/feat/extend-spec-class-for-config-mig…
pnilan May 19, 2025
3983495
update per comments
pnilan May 19, 2025
2b684e7
remove dagger-io
pnilan May 19, 2025
07c96e0
fix test
pnilan May 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
273 changes: 273 additions & 0 deletions airbyte_cdk/sources/declarative/declarative_component_schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3803,6 +3803,61 @@ definitions:
title: Advanced Auth
description: Advanced specification for configuring the authentication flow.
"$ref": "#/definitions/AuthFlow"
config_normalization_rules:
title: Config Normalization Rules
type: object
additionalProperties: false
properties:
config_migrations:
title: Config Migrations
description: The discrete migrations that will be applied on the incoming config. Each migration will be applied in the order they are defined.
type: array
items:
"$ref": "#/definitions/ConfigMigration"
default: []
transformations:
title: Transformations
description: The list of transformations that will be applied on the incoming config at the start of each sync. The transformations will be applied in the order they are defined.
type: array
items:
anyOf:
- "$ref": "#/definitions/ConfigRemapField"
- "$ref": "#/definitions/ConfigAddFields"
- "$ref": "#/definitions/ConfigRemoveFields"
default: []
validations:
title: Validations
description: The list of validations that will be performed on the incoming config at the start of each sync.
type: array
items:
anyOf:
- "$ref": "#/definitions/DpathValidator"
- "$ref": "#/definitions/PredicateValidator"
default: []
ConfigMigration:
title: Config Migration
description: A config migration that will be applied on the incoming config at the start of a sync.
type: object
required:
- type
- transformations
properties:
type:
type: string
enum: [ConfigMigration]
description:
type: string
description: The description/purpose of the config migration.
transformations:
title: Transformations
description: The list of transformations that will attempt to be applied on an incoming unmigrated config. The transformations will be applied in the order they are defined.
type: array
items:
anyOf:
- "$ref": "#/definitions/ConfigRemapField"
- "$ref": "#/definitions/ConfigAddFields"
- "$ref": "#/definitions/ConfigRemoveFields"
default: []
SubstreamPartitionRouter:
title: Substream Partition Router
description: Partition router that is used to retrieve records that have been partitioned according to records from the specified parent streams. An example of a parent stream is automobile brands and the substream would be the various car models associated with each branch.
Expand Down Expand Up @@ -4164,6 +4219,224 @@ definitions:
description: The GraphQL query to be executed
default: {}
additionalProperties: true
DpathValidator:
title: Dpath Validator
description: Validator that extracts the value located at a given field path.
type: object
required:
- type
- field_path
- validation_strategy
properties:
type:
type: string
enum: [DpathValidator]
field_path:
title: Field Path
description: List of potentially nested fields describing the full path of the field to validate. Use "*" to validate all values from an array.
type: array
items:
type: string
interpolation_context:
- config
examples:
- ["data"]
- ["data", "records"]
- ["data", "{{ parameters.name }}"]
- ["data", "*", "record"]
validation_strategy:
title: Validation Strategy
description: The condition that the specified config value will be evaluated against
anyOf:
- "$ref": "#/definitions/ValidateAdheresToSchema"
PredicateValidator:
title: Predicate Validator
description: Validator that applies a validation strategy to a specified value.
type: object
required:
- type
- value
- validation_strategy
properties:
type:
type: string
enum: [PredicateValidator]
value:
title: Value
description: The value to be validated. Can be a literal value or interpolated from configuration.
type:
- string
- number
- object
- array
- boolean
- "null"
interpolation_context:
- config
examples:
- "test-value"
- "{{ config['api_version'] }}"
- "{{ config['tenant_id'] }}"
- 123
validation_strategy:
title: Validation Strategy
description: The validation strategy to apply to the value.
anyOf:
- "$ref": "#/definitions/ValidateAdheresToSchema"
ValidateAdheresToSchema:
title: Validate Adheres To Schema
description: Validates that a user-provided schema adheres to a specified JSON schema.
type: object
required:
- type
- base_schema
properties:
type:
type: string
enum: [ValidateAdheresToSchema]
base_schema:
title: Base JSON Schema
description: The base JSON schema against which the user-provided schema will be validated.
type:
- string
- object
interpolation_context:
- config
examples:
- "{{ config['report_validation_schema'] }}"
- |
'{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Person",
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "The person's name"
},
"age": {
"type": "integer",
"minimum": 0,
"description": "The person's age"
}
},
"required": ["name", "age"]
}'
- $schema: "http://json-schema.org/draft-07/schema#"
title: Person
type: object
properties:
name:
type: string
description: "The person's name"
age:
type: integer
minimum: 0
description: "The person's age"
required:
- name
- age
ConfigRemapField:
title: Remap Field
description: Transformation that remaps a field's value to another value based on a static map.
type: object
required:
- type
- map
- field_path
properties:
type:
type: string
enum: [ConfigRemapField]
map:
title: Value Mapping
description: A mapping of original values to new values. When a field value matches a key in this map, it will be replaced with the corresponding value.
interpolation_context:
- config
type:
- object
- string
additionalProperties: true
examples:
- pending: "in_progress"
done: "completed"
cancelled: "terminated"
- "{{ config['status_mapping'] }}"
field_path:
title: Field Path
description: The path to the field whose value should be remapped. Specified as a list of path components to navigate through nested objects.
interpolation_context:
- config
type: array
items:
type: string
examples:
- ["status"]
- ["data", "status"]
- ["data", "{{ config.name }}", "status"]
- ["data", "*", "status"]
ConfigAddFields:
title: Config Add Fields
description: Transformation that adds fields to a config. The path of the added field can be nested.
type: object
required:
- type
- fields
properties:
type:
type: string
enum: [ConfigAddFields]
fields:
title: Fields
description: A list of transformations (path and corresponding value) that will be added to the config.
type: array
items:
"$ref": "#/definitions/AddedFieldDefinition"
condition:
description: Fields will be added if expression is evaluated to True.
type: string
default: ""
interpolation_context:
- config
- property
examples:
- "{{ config['environemnt'] == 'sandbox' }}"
- "{{ property is integer }}"
- "{{ property|length > 5 }}"
- "{{ property == 'some_string_to_match' }}"
ConfigRemoveFields:
title: Config Remove Fields
description: Transformation that removes a field from the config.
type: object
required:
- type
- field_pointers
properties:
type:
type: string
enum: [ConfigRemoveFields]
field_pointers:
title: Field Pointers
description: A list of field pointers to be removed from the config.
type: array
items:
items:
type: string
examples:
- ["tags"]
- [["content", "html"], ["content", "plain_text"]]
condition:
description: Fields will be removed if expression is evaluated to True.
type: string
default: ""
interpolation_context:
- config
- property
examples:
- "{{ config['environemnt'] == 'sandbox' }}"
- "{{ property is integer }}"
- "{{ property|length > 5 }}"
- "{{ property == 'some_string_to_match' }}"
interpolation:
variables:
- title: config
Expand Down
Loading
Loading