-
Notifications
You must be signed in to change notification settings - Fork 5
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(airbyte-cdk): update datamodel_code_generator to 0.26.3
#31
Conversation
use double-quotes to align with linting rules Signed-off-by: Artem Inzhyyants <[email protected]>
Signed-off-by: Artem Inzhyyants <[email protected]>
📝 Walkthrough📝 WalkthroughWalkthroughThe changes introduced in this pull request involve updates to two files: Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant CodeGenerator
participant HttpResponseFilter
User->>CodeGenerator: Execute command with options
CodeGenerator->>HttpResponseFilter: Generate code with new settings
HttpResponseFilter-->>CodeGenerator: Return formatted code
CodeGenerator-->>User: Provide generated code
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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
🧹 Outside diff range and nitpick comments (2)
bin/generate_component_manifest_files.py (1)
76-77
: Consider consolidating parameter name handlingI notice we're using both
--remove-special-field-name-prefix
and manual string replacement inpost_process_codegen
for parameter naming. Would it make sense to use just one approach? wdyt? 🤔The current implementation:
- Uses
--remove-special-field-name-prefix
flag- Also replaces
" _parameters:"
with" parameters:"
in post-processingWe could potentially simplify this by:
- Either relying solely on the CLI flag
- Or handling all naming conventions in post-processing
What's your preference here?
airbyte_cdk/sources/declarative/models/declarative_component_schema.py (1)
634-634
: Nice addition of the uniqueness constraint! 👍Adding
unique_items=True
to thehttp_codes
field prevents duplicate HTTP status codes in the filter list, which makes sense since having the same status code multiple times would be redundant. What do you think about adding a comment explaining this constraint for future maintainers? wdyt?http_codes: Optional[List[int]] = Field( None, description="Match the response if its HTTP code is included in this list.", examples=[[420, 429], [500]], title="HTTP Codes", + # Prevent duplicate status codes since they would be redundant in a filter unique_items=True, )
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
airbyte_cdk/sources/declarative/models/declarative_component_schema.py
(2 hunks)bin/generate_component_manifest_files.py
(2 hunks)
🔇 Additional comments (3)
bin/generate_component_manifest_files.py (2)
Line range hint 42-46
: Verify Pydantic compatibility
I see we're replacing "from pydantic" with "from pydantic.v1" in post-processing. Just want to double-check - have you verified that datamodel-codegen 0.26.3 works well with Pydantic v1? 🤔
#!/bin/bash
# Description: Check Pydantic compatibility in datamodel-codegen
# Check dependencies for Pydantic version
pip install datamodel-code-generator==0.26.3 --dry-run | grep -i pydantic
# Search for Pydantic-related issues
gh api search/issues -q '.items[] | select(.title | contains("pydantic"))' --raw-field q='repo:koxudaxi/datamodel-code-generator is:issue state:open'
16-16
: Verify breaking changes in datamodel-codegen upgrade
Hey! That's quite a version jump from 0.11.19 to 0.26.3! While this aligns with the PR objective of using double-quotes, shall we verify there aren't any breaking changes that might affect existing code? 🤔
✅ Verification successful
Version upgrade verified without breaking changes.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check release notes and changes between versions
# Get the changelog or release notes
gh api repos/koxudaxi/datamodel-code-generator/releases -q '.[].body' | grep -A 5 "0.26.3\|0.11.19"
# Check for any issues related to version upgrades
gh api search/issues -q '.items[] | select(.title | contains("0.26") or contains("upgrade"))' --raw-field q='repo:koxudaxi/datamodel-code-generator is:issue'
Length of output: 589
Script:
#!/bin/bash
# Description: Fetch release notes for datamodel-code-generator versions 0.11.19 and 0.26.3
gh api repos/koxudaxi/datamodel-code-generator/releases --jq '.[].body' | grep -A 10 "0.26.3\|0.11.19"
# Description: Search for open issues related to version upgrades or breaking changes
gh api search/issues --field q='repo:koxudaxi/datamodel-code-generator is:issue state:open (title:"0.26.3" OR title:"upgrade" OR title:"breaking change")'
Length of output: 1183
Script:
#!/bin/bash
# Description: Fetch release notes for datamodel-code-generator versions 0.11.19 and 0.26.3
gh api repos/koxudaxi/datamodel-code-generator/releases --jq '.[].body' | grep -A 10 "0.26.3\|0.11.19"
# Description: List open issues related to version upgrades or breaking changes using gh issue list
gh issue list --repo koxudaxi/datamodel-code-generator --state open --search "0.26.3 OR upgrade OR \"breaking change\""
Length of output: 1873
airbyte_cdk/sources/declarative/models/declarative_component_schema.py (1)
7-7
: LGTM! Import addition looks good.
The addition of Literal
to the imports is consistent with its usage throughout the file for type annotations.
What
use double-quotes during generation to align with linting rules
Summary by CodeRabbit
New Features
Literal
types.unique_items
attribute inHttpResponseFilter
to enforce uniqueness of HTTP codes.Bug Fixes
Chores
datamodel_code_generator
dependency to the latest version for improved functionality.