<@U04S8PLJWMT> airbyte what are the configs to acc...
# ask-ai
k
@kapa.ai airbyte what are the configs to accomodate 500 api limit exceeded error
k
To accommodate a 500 API limit exceeded error in Airbyte, you should configure error handling and rate limiting in your connector definition. Here’s how you can do it: ### 1. Error Handling for HTTP 500 HTTP 500 is a server error, not a rate limit error, but it is common to retry on such errors as they are often transient. Airbyte recommends using an exponential backoff strategy and limiting the number of retries for server errors like 500:
Copy code
yaml error_handler:   response_filters:     - action: RETRY       http_codes:         - 500         - 502         - 503         - 504   # Example backoff strategy (can be exponential, constant, etc.)   backoff_strategies:     - type: ExponentialBackoffStrategy       initial_wait_seconds: 1       max_wait_seconds: 60       multiplier: 2
- This configuration will retry requests that receive a 500 error, using an exponential backoff, up to a reasonable limit (typically 3-5 attempts for server errors) [Common Error Handling Patterns](https://docs.airbyte.com/platform/next/connector-development/connector-builder-ui/error-handling#common-error-handling-patterns). ### 2. Rate Limiting (API Budget) If your API returns 500 when the rate limit is exceeded (which is unusual—most APIs use 429), you can still treat 500 as a rate limit hit in your configuration:
Copy code
yaml api_budget:   type: "HTTPAPIBudget"   ratelimit_reset_header: "X-RateLimit-Reset"   ratelimit_remaining_header: "X-RateLimit-Remaining"   status_codes_for_ratelimit_hit: [500]   policies:     - type: "FixedWindowCallRatePolicy"       period: "PT1H"       call_limit: 1000       matchers:         - method: "GET"           url_base: "https://api.example.com"           url_path_pattern: "^/users"
- Here,
status_codes_for_ratelimit_hit
includes 500, so Airbyte will treat 500 as a rate limit event and apply the configured rate limiting logic [Rate limiting (API Budget)](https://docs.airbyte.com/platform/next/connector-development/config-based/understanding-the-yaml-file/rate-limit-api-budget). ### 3. Example Error Handler in YAML You can also configure a custom error handler in the YAML builder to retry on 500 errors:
Copy code
yaml error_handler:   response_filters:     - action: RETRY       http_codes:         - 500   backoff_strategies:     - type: ConstantBackoffStrategy       backoff_time_in_seconds: 60
- This will retry on 500 errors with a constant 60-second delay [GitHub Issue Example](https://github.com/airbytehq/airbyte/issues/42928). --- Note: - Most APIs use 429 for rate limit exceeded, not 500. If your API uses 500 for rate limiting, you must explicitly include 500 in both your error handler and
status_codes_for_ratelimit_hit
. - Always test your configuration to ensure it matches your API’s actual behavior. If you need more advanced handling (e.g., custom backoff logic), you can implement a custom error handler class as described in the docs [Advanced Error Handling Configuration](https://docs.airbyte.com/platform/next/connector-development/connector-builder-ui/error-handling#advanced-error-handling-configuration). If you need further clarification or a specific example for your use case, please provide more details about your API and connector setup.
k
@kapa.ai given the following yaml help me understand how the GET requests are sent for each partition of stream tasks : version: 6.60.9 type: DeclarativeSource description: Source for the ticktick openapi endpoint at https://developer.ticktick.com/ check: type: CheckStream stream_names: - projects definitions: linked: HttpRequester: authenticator: type: BearerAuthenticator api_token: "{{ config[\"api_key\"] }}" streams: - type: DeclarativeStream name: projects retriever: type: SimpleRetriever decoder: type: JsonDecoder requester: type: HttpRequester authenticator: $ref: "#/definitions/linked/HttpRequester/authenticator" http_method: GET url: https://api.ticktick.com/open/v1/project record_selector: type: RecordSelector extractor: type: DpathExtractor field_path: [] primary_key: - id schema_loader: type: InlineSchemaLoader schema: type: object $schema: http://json-schema.org/schema# required: - id properties: id: type: string kind: type: - string - "null" name: type: - string - "null" color: type: - string - "null" closed: type: - boolean - "null" groupId: type: - string - "null" viewMode: type: - string - "null" sortOrder: type: - number - "null" permission: type: - string - "null" additionalProperties: true - type: DeclarativeStream name: tasks retriever: type: SimpleRetriever decoder: type: JsonDecoder requester: type: HttpRequester authenticator: $ref: "#/definitions/linked/HttpRequester/authenticator" http_method: GET url: >- https://api.ticktick.com/open/v1/project/{{ stream_partition['parent_id'] }}/data record_selector: type: RecordSelector extractor: type: DpathExtractor field_path: - tasks partition_router: type: SubstreamPartitionRouter parent_stream_configs: - type: ParentStreamConfig stream: $ref: "#/streams/0" parent_key: id partition_field: parent_id primary_key: - id schema_loader: type: InlineSchemaLoader schema: type: object $schema: http://json-schema.org/schema# required: - id properties: id: type: string desc: type: - string - "null" etag: type: - string - "null" kind: type: - string - "null" tags: type: - array - "null" items: type: - string - "null" title: type: - string - "null" status: type: - number - "null" content: type: - string - "null" dueDate: type: - string - "null" columnId: type: - string - "null" isAllDay: type: - boolean - "null" priority: type: - number - "null" timeZone: type: - string - "null" projectId: type: - string - "null" sortOrder: type: - number - "null" startDate: type: - string - "null" repeatFlag: type: - string - "null" additionalProperties: true spec: type: Spec connection_specification: type: object $schema: http://json-schema.org/draft-07/schema# required: - api_key properties: api_key: type: string order: 0 title: API Key airbyte_secret: true additionalProperties: true metadata: assist: {} testedStreams: tasks: hasRecords: true streamHash: c78dbe7a9ef32ba08448acd4dbf94dd6de83d8e9 hasResponse: true primaryKeysAreUnique: true primaryKeysArePresent: true responsesAreSuccessful: true projects: hasRecords: true streamHash: 78b3cae4a919eb24d192a3b747f4d3df856f7294 hasResponse: true primaryKeysAreUnique: true primaryKeysArePresent: true responsesAreSuccessful: true autoImportSchema: tasks: true projects: true applied_migrations: - from_version: 6.48.15 to_version: "*" migration: HttpRequesterUrlBaseToUrl migrated_at: "2025-08-15T151657.278259+00:00" - from_version: 6.48.15 to_version: "*" migration: HttpRequesterPathToUrl migrated_at: "2025-08-15T151657.279060+00:00"
k
A message from kapa.ai
Certainly! Here’s how the GET requests are sent for each partition of the
tasks
stream in your YAML configuration: ### How Partitioning Works - The
tasks
stream uses a
SubstreamPartitionRouter
as its
partition_router
. - The
parent_stream_configs
points to the
projects
stream (the first stream in your list). - The
parent_key
is
id
(from each project record). - The
partition_field
is
parent_id
, which will be used as a variable in the child stream. ### Request Flow 1. Fetch Parent Records: Airbyte first syncs the
projects
stream, retrieving all project records. Each project record has an
id
. 2. Partitioning: For each project
id
, a partition (slice) is created for the
tasks
stream. The value of
id
from the parent project is assigned to
stream_partition['parent_id']
. 3. Request Construction: For each partition, the
tasks
stream sends a GET request to:
Copy code
https://api.ticktick.com/open/v1/project/{{ stream_partition['parent_id'] }}/data
Here,
{{ stream_partition['parent_id'] }}
is replaced with the actual project
id
from the parent stream. For example, if the
projects
stream returns three projects with IDs
abc
,
def
, and
ghi
, the following requests will be made:
Copy code
GET https://api.ticktick.com/open/v1/project/abc/data    GET https://api.ticktick.com/open/v1/project/def/data    GET https://api.ticktick.com/open/v1/project/ghi/data
4. Record Extraction: The response for each request is expected to have a
tasks
field (as per the
field_path: [tasks]
), from which task records are extracted. ### Summary - Each project from the
projects
stream results in one GET request to the
tasks
endpoint, with the project
id
substituted into the URL. - This is a classic parent-child (substream) pattern, where the child stream (
tasks
) is partitioned by the parent stream (
projects
) using the
SubstreamPartitionRouter
and
ParentStreamConfig
settings. This behavior is directly supported by Airbyte’s declarative stream partitioning logic using substreams and is described in the documentation for [SubstreamPartitionRouter](https://docs.airbyte.com/platform/connector-development/config-based/understanding-the-yaml-file/partition-router#substreampartitionrouter) and [ParentStreamConfig](https://docs.airbyte.com/platform/connector-development/config-based/understanding-the-yaml-file/reference#/definitions/ParentStreamConfig).
k
how would those tasks slices be sent are those concurrently or async ? context is i want to configure a delay between those slices to not exceed my rate limit @kapa.ai
k
A message from kapa.ai
By default, Airbyte processes stream partitions (slices) concurrently, and the degree of concurrency can be controlled using the
ConcurrencyLevel
configuration in your YAML. This setting determines how many partitions (in your case, project-based task slices) are processed at the same time. For example, if you set a concurrency level of 5, Airbyte will send up to 5 GET requests for different project/task slices in parallel. To control concurrency and avoid exceeding your rate limit: - Use the
concurrency_level
property in your YAML. You can set a fixed number or make it configurable by the user. For example:
Copy code
yaml concurrency_level:   default_concurrency: 5   max_concurrency: 10
This will ensure that no more than 5 (or up to 10, if configured) slices are processed at once. If you want to introduce a delay between requests (to further control the rate), you would need to use rate limiting features or custom error handling, as Airbyte does not natively support a fixed delay between slices in the declarative YAML alone. Important notes: - If you set
concurrency_level
to 1, only one slice will be processed at a time, but this could cause deadlocks if there are many partitions and dependencies. - For more granular control (like a fixed delay between requests), you would need to implement a custom Python connector and use the CDK’s rate limiting or throttling features, such as
MovingWindowCallRatePolicy
or similar, which allow you to specify request rates and delays programmatically. This is not available in the declarative YAML alone, but is supported in custom Python connectors [Concurrent](https://docs.airbyte.com/platform/next/connector-development/tutorials/custom-python-connector/concurrency). Summary: Slices (partitions) are processed concurrently, and you can control the number of concurrent requests using the
concurrency_level
setting in your YAML. For introducing a delay between requests, you need to use custom Python code with rate limiting policies, as declarative YAML does not support per-slice delays directly [ConcurrencyLevel object](https://docs.airbyte.com/platform/next/connector-development/config-based/understanding-the-yaml-file/reference#/definitions/ConcurrencyLevel).
k
@kapa.ai in airbyte if i have a connector PR submitted and merged what is the process for the next time to add changes and additional PR ? cause I lost access to the original airbyte self host server that submitted that connection. i still have access to the forked github repo
k
A message from kapa.ai
If your original connector PR has already been merged into the main Airbyte repository, you do not need access to your original self-hosted Airbyte server to submit further changes. The process for submitting additional changes is as follows: 1. Update Your Fork: Sync your forked GitHub repository with the latest changes from the main Airbyte repository. This ensures your new work is based on the most recent code. 2. Create a New Branch: Create a new branch in your fork for your changes (do not use the master branch of your fork). The branch name should follow the format
{YOUR_USERNAME}/{FEATURE/BUG}
(e.g.,
jdoe/source-stock-api-stream-fix
) [Code Contributions](https://docs.airbyte.com/platform/contributing-to-airbyte#code-contributions). 3. Make and Commit Changes: Implement your changes or enhancements to the connector in this new branch. 4. Push and Submit a PR: Push your branch to your forked repository and submit a new Pull Request (PR) to the main Airbyte repository. 5. Link to an Issue: Link your PR to an existing issue (or create a new one if needed). PRs without a linked issue may take longer to review. 6. Follow PR Guidelines: Make sure your PR title and description follow the [Pull Request Handbook](https://docs.airbyte.com/platform/contributing-to-airbyte/resources/pull-requests-handbook). 7. Review and Merge: An Airbyte maintainer will review your PR, trigger CI tests, and provide feedback. Once approved, your changes will be merged. Note: - You do not need access to the original Airbyte server that was used to submit the first PR. All you need is access to your forked GitHub repository. - Do not submit PRs from the master branch of your fork; always use a feature branch [Code Contributions](https://docs.airbyte.com/platform/contributing-to-airbyte#code-contributions). If you need to test your connector locally, you can follow the [developing locally guide](https://docs.airbyte.com/platform/contributing-to-airbyte/developing-locally#connector-contributions), but this does not require the original server—just a local development environment. If you have lost access to your forked repo, you would need to fork the main Airbyte repo again, but since you still have access, you can continue as described above.
k
@kapa.ai in a stream if i want to ignore certain parent partition by specific keys in the partition how do i do that
k
A message from kapa.ai
To ignore certain parent partitions by specific keys in a stream, you can use a RecordFilter on the parent stream to exclude records with those keys. This way, only the desired parent records will be used to generate partitions for the substream. For example, if you want to ignore parent records where the key
id
is in a specific list, you can add a
RecordFilter
to the parent stream like this:
Copy code
yaml record_filter:   type: RecordFilter   condition: "{{ record['id'] not in ['key1', 'key2', 'key3'] }}"
This filter will ensure that any parent record with an
id
of
key1
,
key2
, or
key3
will be ignored, and thus no partitions will be created for those keys in the child stream. The filter expression can use any available variables and logic as described in the documentation [RecordFilter object](https://docs.airbyte.com/platform/next/connector-development/config-based/understanding-the-yaml-file/reference#/definitions/RecordFilter). Summary: Add a
RecordFilter
to your parent stream to exclude specific keys, and those partitions will not be created for the substream. If you need to filter based on more complex logic or multiple fields, you can adjust the
condition
accordingly, using the available variables in the filter context [Record Filter](https://docs.airbyte.com/platform/next/connector-development/connector-builder-ui/record-processing#record-filter).
k
thing is i dont wanna filter on the parent, only want to filter the children to not extract certain parent partitions @kapa.ai
k
A message from kapa.ai
If you want to filter out certain parent partitions only at the child (substream) level—meaning you want to skip extracting data for specific parent keys, but not filter the parent stream itself—the declarative YAML model in Airbyte does not provide a direct way to do this at the substream/partition router level. The available filtering mechanism (
RecordFilter
) is designed to filter records within a stream, not to skip entire partitions based on parent keys at the child stream level. The partitioning logic in
SubstreamPartitionRouter
will create a partition for every parent record unless the parent itself is filtered out in the parent stream using a `RecordFilter`[RecordFilter object](https://docs.airbyte.com/platform/next/connector-development/config-based/understanding-the-yaml-file/reference#/definitions/RecordFilter). There is no documented way in the provided knowledge sources to filter or skip specific parent partitions only at the child stream level without affecting the parent stream's output. Summary: Based on the current Airbyte declarative YAML capabilities and the documentation, you cannot filter out specific parent partitions only at the child stream level; filtering must be done at the parent stream. If you need this behavior, you may need to implement a custom connector in Python. If you need more advanced partition filtering at the child level, the knowledge sources do not provide a declarative solution for this scenario.
k
@kapa.ai is this the way to filter ?
k
A message from kapa.ai
k
{{ record['closed'] }} is undefined
k
Based on the knowledge sources, the declarative way to filter out specific parent partitions at the child (substream) level is not directly supported. The
RecordFilter
component is designed to filter records within a stream, not to skip entire partitions based on parent keys at the child stream level. Filtering of parent partitions must be done at the parent stream using a `RecordFilter`—there is no documented way to apply such a filter only at the child stream level without affecting the parent stream's output [RecordFilter object](https://docs.airbyte.com/platform/next/connector-development/config-based/understanding-the-yaml-file/reference#/definitions/RecordFilter). Summary: No, filtering specific parent partitions only at the child stream level is not supported declaratively in Airbyte according to the current documentation. Filtering must be applied at the parent stream if you want to exclude certain partitions from being processed by the child stream.
k
@kapa.ai is this the correct syntax for filter for only records that do not have this key 'closed'
Copy code
{{ record['closed'] }} is undefined
k
A message from kapa.ai
The knowledge sources do not explicitly document the use of the keyword
undefined
in filter expressions for Airbyte. The documented way to check if a key is missing or its value is
None
is to use Python-like expressions such as
record.get('closed') is not none
or
record.get('closed') is none
. To filter for only records that do not have the key
'closed'
, you should use:
Copy code
yaml {{ record.get('closed') is none }}
This expression will include only records where the
'closed'
key is missing or its value is
None
 [Record Filter](https://docs.airbyte.com/platform/next/connector-development/connector-builder-ui/record-processing#record-filter). There is no mention in the documentation of using
is undefined
as a valid syntax. If you use
is undefined
, it may not work as expected. Summary: Use
{{ record.get('closed') is none }}
to filter for records that do not have the
'closed'
key.