Skip to content

Conversation

lmossman
Copy link
Contributor

@lmossman lmossman commented Jun 27, 2025

Some more reordering and modifying titles/defaults, this time for partition router fields.

This is to get things to look and behave as desired in the Builder UI

Summary by CodeRabbit

  • Documentation
    • Improved descriptions for certain configuration options to provide clearer guidance.
  • Style
    • Adjusted the order of properties in configuration schemas for better readability and consistency.
  • Chores
    • Updated default values and property arrangements in schemas without affecting existing functionality.

@github-actions github-actions bot added the chore label Jun 27, 2025
Copy link

github-actions bot commented Jun 27, 2025

PyTest Results (Fast)

3 676 tests  ±0   3 665 ✅ ±0   6m 21s ⏱️ +7s
    1 suites ±0      11 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit 951c9e0. ± Comparison against base commit 2e13549.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Jun 27, 2025

PyTest Results (Full)

3 679 tests  ±0   3 668 ✅ ±0   18m 15s ⏱️ +16s
    1 suites ±0      11 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit 951c9e0. ± Comparison against base commit 2e13549.

♻️ This comment has been updated with latest results.

@lmossman lmossman force-pushed the lmossman/more-reordering-in-declarative-schema branch from 0c28494 to 951c9e0 Compare July 1, 2025 17:09
@lmossman lmossman marked this pull request as ready for review July 1, 2025 17:09
@lmossman lmossman requested review from Copilot and aldogonzalez8 July 1, 2025 17:09
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

A chore to reorder and update titles and defaults for partition router fields to improve Builder UI behavior.

  • Reordered ParentStreamConfig fields and moved lazy_read_pointer below incremental_dependency.
  • Changed partition_router default from an empty list to None and updated its description.
  • Synced YAML schema: mirrored Python changes, removed obsolete defaults, and added a title for multiple routers.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
airbyte_cdk/sources/declarative/models/declarative_component_schema.py Reordered fields in ParentStreamConfig and updated partition_router default and description.
airbyte_cdk/sources/declarative/declarative_component_schema.yaml Mirrored field order changes, removed default arrays, added Multiple Partition Routers title.
Comments suppressed due to low confidence (4)

airbyte_cdk/sources/declarative/models/declarative_component_schema.py:2789

  • Changing the default of partition_router from [] to None alters the API contract and could break downstream code that expects a list. Consider documenting this breaking change or providing a migration path.
        None,

airbyte_cdk/sources/declarative/declarative_component_schema.yaml:3138

  • The YAML title for partition_field (Current Parent Key Value Identifier) does not match the Python schema title (Partition Field). Align these titles to avoid confusion in the UI.
        title: Current Parent Key Value Identifier

airbyte_cdk/sources/declarative/declarative_component_schema.yaml:3593

  • The YAML schema no longer specifies a default for partition_router. To clearly reflect the Python default of None, consider adding default: null in the schema.
      partition_router:

airbyte_cdk/sources/declarative/models/declarative_component_schema.py:2773

  • With the updated default behavior of partition_router being None, add or update tests to verify that downstream code handles a None value correctly.
    partition_router: Optional[

Copy link
Contributor

coderabbitai bot commented Jul 1, 2025

📝 Walkthrough

Walkthrough

The changes involve reordering properties and updating descriptions in both the YAML schema and Python model for declarative components. No structural or functional logic was altered; only the order of fields, default values, and property descriptions were modified to improve clarity and consistency.

Changes

File(s) Change Summary
airbyte_cdk/sources/declarative/declarative_component_schema.yaml Reordered stream and lazy_read_pointer in ParentStreamConfig; updated partition_router description and order in SimpleRetriever; added title to array type option.
airbyte_cdk/sources/declarative/models/declarative_component_schema.py Reordered stream and lazy_read_pointer fields in ParentStreamConfig; updated partition_router default, type order, and description in SimpleRetriever.

Sequence Diagram(s)

No sequence diagram generated, as the changes are limited to property order and descriptions without affecting control flow or interactions.

Would you like to see a suggestion for documenting these changes in your changelog, wdyt?

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
airbyte_cdk/sources/declarative/declarative_component_schema.yaml (1)

3595-3599: Updated description reads well – mirror it in docs?

The new wording for partition_router is clearer. Should the public docs/snippets be refreshed to keep wording consistent, wdyt?

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2e13549 and 951c9e0.

📒 Files selected for processing (2)
  • airbyte_cdk/sources/declarative/declarative_component_schema.yaml (3 hunks)
  • airbyte_cdk/sources/declarative/models/declarative_component_schema.py (3 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: ChristoGrab
PR: airbytehq/airbyte-python-cdk#58
File: airbyte_cdk/sources/declarative/yaml_declarative_source.py:0-0
Timestamp: 2024-11-18T23:40:06.391Z
Learning: When modifying the `YamlDeclarativeSource` class in `airbyte_cdk/sources/declarative/yaml_declarative_source.py`, avoid introducing breaking changes like altering method signatures within the scope of unrelated PRs. Such changes should be addressed separately to minimize impact on existing implementations.
Learnt from: pnilan
PR: airbytehq/airbyte-python-cdk#0
File: :0-0
Timestamp: 2024-12-11T16:34:46.319Z
Learning: In the airbytehq/airbyte-python-cdk repository, the `declarative_component_schema.py` file is auto-generated from `declarative_component_schema.yaml` and should be ignored in the recommended reviewing order.
Learnt from: aaronsteers
PR: airbytehq/airbyte-python-cdk#174
File: airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py:1093-1102
Timestamp: 2025-01-14T00:20:32.310Z
Learning: In the `airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py` file, the strict module name checks in `_get_class_from_fully_qualified_class_name` (requiring `module_name` to be "components" and `module_name_full` to be "source_declarative_manifest.components") are intentionally designed to provide early, clear feedback when class declarations won't be found later in execution. These restrictions may be loosened in the future if the requirements for class definition locations change.
Learnt from: aaronsteers
PR: airbytehq/airbyte-python-cdk#58
File: airbyte_cdk/cli/source_declarative_manifest/_run.py:62-65
Timestamp: 2024-11-15T01:04:21.272Z
Learning: The files in `airbyte_cdk/cli/source_declarative_manifest/`, including `_run.py`, are imported from another repository, and changes to these files should be minimized or avoided when possible to maintain consistency.
airbyte_cdk/sources/declarative/models/declarative_component_schema.py (3)

undefined

<retrieved_learning>
Learnt from: pnilan
PR: airbytehq/airbyte-python-cdk#0
File: :0-0
Timestamp: 2024-12-11T16:34:46.319Z
Learning: In the airbytehq/airbyte-python-cdk repository, the declarative_component_schema.py file is auto-generated from declarative_component_schema.yaml and should be ignored in the recommended reviewing order.
</retrieved_learning>

<retrieved_learning>
Learnt from: ChristoGrab
PR: #58
File: airbyte_cdk/sources/declarative/yaml_declarative_source.py:0-0
Timestamp: 2024-11-18T23:40:06.391Z
Learning: When modifying the YamlDeclarativeSource class in airbyte_cdk/sources/declarative/yaml_declarative_source.py, avoid introducing breaking changes like altering method signatures within the scope of unrelated PRs. Such changes should be addressed separately to minimize impact on existing implementations.
</retrieved_learning>

<retrieved_learning>
Learnt from: aaronsteers
PR: #58
File: airbyte_cdk/cli/source_declarative_manifest/_run.py:62-65
Timestamp: 2024-11-15T01:04:21.272Z
Learning: The files in airbyte_cdk/cli/source_declarative_manifest/, including _run.py, are imported from another repository, and changes to these files should be minimized or avoided when possible to maintain consistency.
</retrieved_learning>

airbyte_cdk/sources/declarative/declarative_component_schema.yaml (4)

undefined

<retrieved_learning>
Learnt from: ChristoGrab
PR: #58
File: airbyte_cdk/sources/declarative/yaml_declarative_source.py:0-0
Timestamp: 2024-11-18T23:40:06.391Z
Learning: When modifying the YamlDeclarativeSource class in airbyte_cdk/sources/declarative/yaml_declarative_source.py, avoid introducing breaking changes like altering method signatures within the scope of unrelated PRs. Such changes should be addressed separately to minimize impact on existing implementations.
</retrieved_learning>

<retrieved_learning>
Learnt from: pnilan
PR: airbytehq/airbyte-python-cdk#0
File: :0-0
Timestamp: 2024-12-11T16:34:46.319Z
Learning: In the airbytehq/airbyte-python-cdk repository, the declarative_component_schema.py file is auto-generated from declarative_component_schema.yaml and should be ignored in the recommended reviewing order.
</retrieved_learning>

<retrieved_learning>
Learnt from: aaronsteers
PR: #58
File: airbyte_cdk/cli/source_declarative_manifest/_run.py:62-65
Timestamp: 2024-11-15T01:04:21.272Z
Learning: The files in airbyte_cdk/cli/source_declarative_manifest/, including _run.py, are imported from another repository, and changes to these files should be minimized or avoided when possible to maintain consistency.
</retrieved_learning>

<retrieved_learning>
Learnt from: aaronsteers
PR: #58
File: airbyte_cdk/cli/source_declarative_manifest/spec.json:9-15
Timestamp: 2024-11-15T00:59:08.154Z
Learning: When code in airbyte_cdk/cli/source_declarative_manifest/ is being imported from another repository, avoid suggesting modifications to it during the import process.
</retrieved_learning>

⏰ Context from checks skipped due to timeout of 90000ms (9)
  • GitHub Check: Check: source-hardcoded-records
  • GitHub Check: Check: source-intercom
  • GitHub Check: Check: source-amplitude
  • GitHub Check: Check: source-pokeapi
  • GitHub Check: Check: source-shopify
  • GitHub Check: Pytest (Fast)
  • GitHub Check: Pytest (All, Python 3.10, Ubuntu)
  • GitHub Check: SDM Docker Image Build
  • GitHub Check: Pytest (All, Python 3.11, Ubuntu)
🔇 Additional comments (4)
airbyte_cdk/sources/declarative/models/declarative_component_schema.py (1)

1-2963: Auto-generated file - changes appear to be correctly propagated from the source schema.

Based on the retrieved learnings, this file is auto-generated from declarative_component_schema.yaml and typically should be ignored during code review. The changes visible here (field reordering in ParentStreamConfig and SimpleRetriever classes, and default value updates) appear to be correctly propagated from the underlying YAML schema changes, which aligns with the PR objective of improving Builder UI appearance and behavior.

Since this is generated code, manual review of implementation details isn't necessary - the focus should be on ensuring the source schema changes are appropriate, wdyt?

airbyte_cdk/sources/declarative/declarative_component_schema.yaml (3)

3124-3130: Property order change looks safe

Re-ordering stream to the top of the properties list shouldn’t affect validation, and it will surface the most-relevant field first in Builder UI – nice touch! 👍 wdyt?


3153-3162: Double-check downstream UI expectations after moving lazy_read_pointer

Moving this block farther down is inert for pure JSON-Schema validation, but a few internal rendering tools rely on the YAML order to decide field placement. Could you verify the Builder still renders lazy_read_pointer where you expect, just to be safe, wdyt?


3602-3607: Array-type title addition LGTM

Adding the “Multiple Partition Routers” title will improve UI grouping without breaking existing manifests – looks good!

Copy link
Contributor

@aldogonzalez8 aldogonzalez8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

APPROVED

@lmossman lmossman merged commit 1733ec3 into main Jul 1, 2025
28 checks passed
@lmossman lmossman deleted the lmossman/more-reordering-in-declarative-schema branch July 1, 2025 17:57
octavia-squidington-iii pushed a commit to airbytehq/airbyte-platform that referenced this pull request Jul 8, 2025
## What
This PR overrides the parent stream config `stream` in the Builder UI to render a dropdown allowing the user to simply select the parent stream.

This is necessary because the [schema for the parent stream field](https://github.com/airbytehq/airbyte-python-cdk/blob/5824a5eabcd4e4bd72cbb06af7d6f18430ca1be5/airbyte_cdk/sources/declarative/declarative_component_schema.yaml#L3164-L3169) is simply a nested stream, so the default SchemaForm behavior is to render an entire nested stream form UI for this field, like in this screenshot:
![Screenshot 2025-06-27 at 4 51 57 PM](https://github.com/user-attachments/assets/a21633fe-477a-4411-9021-1d5366020d0c)

This is not a good UX, as we don't want to show an entire nested stream form in this case.

## How
This PR solves the issue by using SchemaForm overrides to render the custom [ParentStreamSelector component](https://github.com/airbytehq/airbyte-platform-internal/pull/16809/files#diff-ca8382b13f366cc8915a7548db4813bf52b3675e444dfda0963b4e305a40425cR895), which checks if the value contains a `$ref` (which it should as we are normalizing the manifest when loading into into the UI - see airbytehq/airbyte-platform-internal#16708 for details on that), and simply renders a dropdown menu containing the names of all other streams.

When the user selects a stream from this menu, this component writes a `$ref` to that field pointing to the selected stream.

Here is what this looks like:
![Screenshot 2025-06-27 at 4 57 18 PM](https://github.com/user-attachments/assets/2a888f83-4abb-45c7-ac13-15dee9145411)

As you can see, this is a much more reasonable user experience for configuring a parent stream. Note that the field order is slightly different than you would see when testing this branch, as that screenshot includes the changes from my python CDK PR [here](airbytehq/airbyte-python-cdk#626).

---

Using a `$ref` for the parent stream field in the actual form required making a few other changes to make everything play nicely:
- [ConnectorBuilderStateService.tsx](https://github.com/airbytehq/airbyte-platform-internal/pull/16809/files#diff-9d461bd6ebcf80e74b63d4061cf322a9979e5542b28857d139f8c82b6aaf4c5b) - we can no longer filter the manifest down to just the stream being tested when running a test read, as it needs the other streams in case any are being pointed to with a `$ref`
- [useBuilderErrors.ts](https://github.com/airbytehq/airbyte-platform-internal/pull/16809/files#diff-3e6cff93a47accbabb30b171c9fbbda89012c3393deb1389aeca18ed5b6f9edd) and [useFocusField.ts](https://github.com/airbytehq/airbyte-platform-internal/pull/16809/files#diff-e9f3e416dcb1d95b7c718d1cb8509f668279c447f682ad5c2e72743bd530b4ad) - drive-by fixes to make the error and focusing behavior work better across different stream views and tabs
- [dynamicValidator.ts](https://github.com/airbytehq/airbyte-platform-internal/pull/16809/files#diff-cd80c0cf03bbe7e00e8a3b503cb13fa2f890acecaf7ca35bd91ff844a28f6dd6) - don't try to validate fields with `$ref` values, as they will not conform to the schema
- [updateStreamsAndRefsAfterDelete()](https://github.com/airbytehq/airbyte-platform-internal/pull/16809/files#diff-ca8382b13f366cc8915a7548db4813bf52b3675e444dfda0963b4e305a40425cR976) - since streams are pointed to with $refs by _index_, we need to update these $refs when a stream is removed, as that is the only time the index of an existing stream may change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants